Add #query_each . Fixes #18

This commit is contained in:
Brian J. Cardiff 2017-04-10 12:48:48 -03:00
parent 5697bd5c58
commit 39e17f82ca
2 changed files with 36 additions and 4 deletions

View file

@ -208,6 +208,24 @@ describe DummyDriver do
end
end
describe "query each" do
it "queries" do
with_dummy do |db|
i = 0
db.query_each "3,4 1,2" do |rs|
case i
when 0
rs.read(Int64, Int64).should eq({3i64, 4i64})
when 1
rs.read(Int64, Int64).should eq({1i64, 2i64})
end
i += 1
end
i.should eq(2)
end
end
end
it "reads multiple values" do
with_dummy do |db|
db.query "3,4 1,2" do |rs|