Skip to content

Commit 7eaa4f0

Browse files
committed
only assert current_database if config[:database] is set
1 parent eaf8a64 commit 7eaa4f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/db/postgresql/schema_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ def test_ctype
4848
end if ar_version('4.0') # ctype added in AR 4.0
4949

5050
def test_current_database
51-
db = current_connection_config[:database]
52-
assert_equal db, connection.current_database
51+
assert_not_nil connection.current_database
52+
if db = current_connection_config[:database]
53+
assert_equal db, connection.current_database
54+
end
5355
end
5456

5557
def test_current_schema

0 commit comments

Comments
 (0)