diff options
author | Kir Shatrov <shatrov@me.com> | 2017-02-25 19:44:42 -0600 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2017-02-25 19:44:42 -0600 |
commit | cb3270cf4e13cfb6ba554e0fa52402657c51d171 (patch) | |
tree | 5599eb4eb91437803c8babd7c0e2c24125f4f42b /activerecord/test/cases | |
parent | d13bc5df902a2c82c3096b627830be97acbedf50 (diff) | |
download | rails-cb3270cf4e13cfb6ba554e0fa52402657c51d171.tar.gz rails-cb3270cf4e13cfb6ba554e0fa52402657c51d171.tar.bz2 rails-cb3270cf4e13cfb6ba554e0fa52402657c51d171.zip |
Use ensure block for things we cleanup in tests
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/connection_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/connection_test.rb | 1 |
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 bae283a048..58bf3003b8 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 |