diff --git a/test/test_http_cookie_jar.rb b/test/test_http_cookie_jar.rb index 2b660c4..b7b6dcc 100644 --- a/test/test_http_cookie_jar.rb +++ b/test/test_http_cookie_jar.rb @@ -805,15 +805,15 @@ module TestHTTPCookieJar jar = HTTP::CookieJar.new(:store => :mozilla, :filename => ':memory:') add_and_delete(jar) db = jar.store.instance_variable_get(:@db) - break - } - at_exit { - GC.start - if db.closed? - puts "finalizer worked" - else - puts "finalizer did not work" + class << db + alias close_orig close + def close + STDERR.print "[finalizer is called]" + STDERR.flush + close_orig + end end + break } end