Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ class ClientTest < TinyTds::TestCase
end
assert_new_connections_work
end

it "raises TinyTds exception with invalid database name" do
action = lambda { new_connection(database: "DOESNOTEXIST") }

assert_raise_tinytds_error(action) do |e|
assert_equal 911, e.db_error_number
assert_equal 16, e.severity
assert_equal "Database 'DOESNOTEXIST' does not exist. Make sure that the name is entered correctly.", e.message
end

assert_new_connections_work
end
end

describe "#parse_username" do
Expand Down