Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ensure block for things we cleanup in tests #28169

Merged
merged 1 commit into from
Feb 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion activerecord/test/cases/adapters/mysql2/connection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_no_automatic_reconnection_after_timeout
@connection.update("set @@wait_timeout=1")
sleep 2
assert !@connection.active?

ensure
# Repair all fixture connections so other tests won't break.
@fixture_connections.each(&:verify!)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def test_reconnection_after_actual_disconnection_with_verify
"umm -- looks like you didn't break the connection, because we're still " \
"successfully querying with the same connection pid."

ensure
# Repair all fixture connections so other tests won't break.
@fixture_connections.each(&:verify!)
end
Expand Down