Skip to content

Commit

Permalink
Merge pull request #26869 from prathamesh-sonpatki/fix-brittle-mysql-…
Browse files Browse the repository at this point in the history
…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 d948bcd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activerecord/test/cases/adapters/mysql2/connection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d948bcd

Please sign in to comment.