diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-07-01 17:59:43 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-07-01 17:59:43 -0700 |
commit | 9d599abe0febd96d7cd1f22e7d5f380187ae4476 (patch) | |
tree | 98af019938a39ab491c504c5102852186d439b43 /activerecord/test | |
parent | ad778bc422b338a7ef4de613a5919667ce2196ba (diff) | |
download | rails-9d599abe0febd96d7cd1f22e7d5f380187ae4476.tar.gz rails-9d599abe0febd96d7cd1f22e7d5f380187ae4476.tar.bz2 rails-9d599abe0febd96d7cd1f22e7d5f380187ae4476.zip |
do not hold on to a stale connection object. fixes #15998
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migration/pending_migrations_test.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/test/cases/migration/pending_migrations_test.rb b/activerecord/test/cases/migration/pending_migrations_test.rb index eff000e1a4..517ee695ce 100644 --- a/activerecord/test/cases/migration/pending_migrations_test.rb +++ b/activerecord/test/cases/migration/pending_migrations_test.rb @@ -8,14 +8,17 @@ module ActiveRecord super @connection = MiniTest::Mock.new @app = MiniTest::Mock.new - @pending = CheckPending.new(@app, @connection) + conn = @connection + @pending = Class.new(CheckPending) { + define_method(:connection) { conn } + }.new(@app) @pending.instance_variable_set :@last_check, -1 # Force checking end def teardown - super assert @connection.verify assert @app.verify + super end def test_errors_if_pending |