Skip to content

Commit 3c350e6

Browse files
authored
Add missing test for dbopen (#600)
1 parent b6e25d4 commit 3c350e6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/client_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,18 @@ class ClientTest < TinyTds::TestCase
200200
end
201201
assert_new_connections_work
202202
end
203+
204+
it "raises TinyTds exception with invalid database name" do
205+
action = lambda { new_connection(database: "DOESNOTEXIST") }
206+
207+
assert_raise_tinytds_error(action) do |e|
208+
assert_equal 911, e.db_error_number
209+
assert_equal 16, e.severity
210+
assert_equal "Database 'DOESNOTEXIST' does not exist. Make sure that the name is entered correctly.", e.message
211+
end
212+
213+
assert_new_connections_work
214+
end
203215
end
204216

205217
describe "#parse_username" do

0 commit comments

Comments
 (0)