allow scalar to return custom types

This commit is contained in:
Brian J. Cardiff 2016-06-23 22:19:53 -03:00
parent 34ae9d5775
commit b2da4f3f6e
3 changed files with 9 additions and 20 deletions

View file

@ -197,6 +197,13 @@ describe DB do
end
end
it "drivers should return custom values as scalar" do
DB.open("foo://host") do |db|
FooDriver.fake_row = [FooValue.new(3), FooValue.new(99)] of FooDriver::Any
db.scalar("query").as(FooValue).value.should eq(3)
end
end
it "Foo and Bar drivers should not implement each other read" do
with_witness do |w|
DB.open("foo://host") do |db|