Permalink
Browse files

Merge pull request #26869 from prathamesh-sonpatki/fix-brittle-mysql-…

…tests

Fix brittle tests which were relying on the error message text from mysql2 gem
  • Loading branch information...
guilleiguaran committed Oct 25, 2016
1 parent 17d492d commit d948bcd1a4b1d49ae792b6a6311344c87731aa1b
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 /closed MySQL connection/, 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 /closed MySQL connection/, error.message
end
def test_active_after_disconnect

0 comments on commit d948bcd

Please sign in to comment.