Skip to content

Commit b8e6cdd

Browse files
committed
test filename with attached databases
1 parent f1ffca5 commit b8e6cdd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/test_database.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ def test_filename
3232
tf.unlink
3333
end
3434

35+
def test_filename_with_attachment
36+
assert_equal '', @db.filename
37+
tf = Tempfile.new
38+
@db.execute "ATTACH DATABASE '#{tf.path}' AS 'testing'"
39+
assert_equal tf.path, @db.filename('testing')
40+
ensure
41+
tf.unlink
42+
end
43+
3544
def test_bignum
3645
num = 4907021672125087844
3746
db.execute 'CREATE TABLE "employees" ("token" integer(8), "name" varchar(20) NOT NULL)'

0 commit comments

Comments
 (0)