Fix brittle tests which were relying on the error message text from mysql2 gem
- These tests were fixed earlier on master inf13ec72664
. - They started failing in first place due to change inf14023fcfe
. - 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:
parent
0fdeb07636
commit
c5a4d007b8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user