Permalink
Browse files

Fix brittle tests which were relying on the error message text from m…

…ysql2 gem

- These tests were fixed earlier on master in f13ec72.
- They started failing in first place due to change in brianmario/mysql2@f14023f.
- They will fail again when the message is changed in mysql2 so let's
  not rely on the error message.
  • Loading branch information...
prathamesh-sonpatki committed Oct 23, 2016
1 parent 0fdeb07 commit c5a4d007b8147c2f042844ac267821afa378d8e5
Showing with 4 additions and 4 deletions.
  1. +4 −4 activerecord/test/cases/adapters/mysql2/connection_test.rb
@@ -65,18 +65,18 @@ def test_successful_reconnection_after_timeout_with_verify
def test_execute_after_disconnect
@connection.disconnect!
error = assert_raise(ActiveRecord::StatementInvalid) do
assert_raise(ActiveRecord::StatementInvalid) do
@connection.execute("SELECT 1")
end
assert_match(/MySQL client is not connected/, error.message)
end
def test_quote_after_disconnect
@connection.disconnect!
error = assert_raise(Mysql2::Error) do
assert_raise(Mysql2::Error) do
@connection.quote("string")
end
assert_match(/MySQL client is not connected/, error.message)
end
def test_active_after_disconnect

0 comments on commit c5a4d00

Please sign in to comment.