mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
avoid messing with finalize cycle in Disposable.
ensure statements are closed when connection is closed
This commit is contained in:
parent
f836bbfccb
commit
34ae9d5775
4 changed files with 39 additions and 5 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue