aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-02-26 14:14:21 +1030
committerGitHub <noreply@github.com>2017-02-26 14:14:21 +1030
commit0bd0c2886f0f74ae3af52c114b912ce5be3176f8 (patch)
tree39b2eaaa0bfaa4fed67de9f36106c0de1b0d8e62 /activerecord
parentd38e5d2719ad8f236d3bd30c60a113d8087db43e (diff)
parentcb3270cf4e13cfb6ba554e0fa52402657c51d171 (diff)
downloadrails-0bd0c2886f0f74ae3af52c114b912ce5be3176f8.tar.gz
rails-0bd0c2886f0f74ae3af52c114b912ce5be3176f8.tar.bz2
rails-0bd0c2886f0f74ae3af52c114b912ce5be3176f8.zip
Merge pull request #28169 from kirs/ensure-conn-verify
Use ensure block for things we cleanup in tests
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/adapters/mysql2/connection_test.rb2
-rw-r--r--activerecord/test/cases/adapters/postgresql/connection_test.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/connection_test.rb b/activerecord/test/cases/adapters/mysql2/connection_test.rb
index ae9ea1c573..c99ab4c39f 100644
--- a/activerecord/test/cases/adapters/mysql2/connection_test.rb
+++ b/activerecord/test/cases/adapters/mysql2/connection_test.rb
@@ -42,7 +42,7 @@ class Mysql2ConnectionTest < ActiveRecord::Mysql2TestCase
@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
diff --git a/activerecord/test/cases/adapters/postgresql/connection_test.rb b/activerecord/test/cases/adapters/postgresql/connection_test.rb
index 3cbd4ca212..98d392f25a 100644
--- a/activerecord/test/cases/adapters/postgresql/connection_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/connection_test.rb
@@ -178,6 +178,7 @@ module ActiveRecord
"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