avoid messing with finalize cycle in Disposable.

ensure statements are closed when connection is closed
This commit is contained in:
Brian J. Cardiff 2016-06-23 22:07:59 -03:00
parent f836bbfccb
commit 34ae9d5775
4 changed files with 39 additions and 5 deletions

View file

@ -65,6 +65,15 @@ describe DB::Statement do
end
end
it "closing connection should close statement" do
stmt = uninitialized DB::Statement
with_dummy do |db|
stmt = db.prepare "3,4 1,2"
stmt.query
end
stmt.closed?.should be_true
end
it "query with block should not close statement" do
with_dummy do |db|
stmt = db.prepare "3,4 1,2"