Fix brittle tests which were relying on the error message text from mysql2 gem

- These tests were fixed earlier on master in f13ec72664.
- They started failing in first place due to change in f14023fcfe.
- They will fail again when the message is changed in mysql2 so let's
  not rely on the error message.
This commit is contained in:
Prathamesh Sonpatki 2016-10-23 21:17:31 +05:30
parent 0fdeb07636
commit c5a4d007b8
No known key found for this signature in database
GPG Key ID: 8B90F6B89E2BCB71

@ -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