Skip to content

Commit 1fb7ad5

Browse files
committed
Merge pull request #332 from sodabrew/fix_conn_spec
Fix the connection exception spec
2 parents bd2425b + 0041454 commit 1fb7ad5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/mysql2/client_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
it "should raise an exception upon connection failure" do
1010
lambda {
11-
Mysql2::Client.new DatabaseCredentials['root'].merge(:port => 999999)
11+
# The odd local host IP address forces the mysql client library to
12+
# use a TCP socket rather than a domain socket.
13+
Mysql2::Client.new DatabaseCredentials['root'].merge(:host => '127.0.0.2', :port => 999999)
1214
}.should raise_error(Mysql2::Error)
1315
end
1416

0 commit comments

Comments
 (0)