We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 551fe2a commit efc0103Copy full SHA for efc0103
1 file changed
test/test_database.rb
@@ -47,12 +47,12 @@ def test_filename_with_attachment
47
48
49
def test_filename_to_path
50
- assert_equal '', @db.filename
51
- pn = Pathname(Tempfile.new('thing').path)
52
- @db = SQLite3::Database.new pn
53
- assert_equal pn.expand_path.to_s, File.expand_path(@db.filename)
+ tf = Tempfile.new 'thing'
+ pn = Pathname tf.path
+ db = SQLite3::Database.new pn
+ assert_equal pn.expand_path.to_s, File.expand_path(db.filename)
54
ensure
55
- pn.unlink if pn.exist?
+ tf.close! if tf
56
end
57
58
0 commit comments