diff options
author | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-03-28 18:54:35 -0700 |
---|---|---|
committer | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-03-28 18:56:40 -0700 |
commit | 0212a41700a4e9cd0a6eb2a0811608ea13f8c5b3 (patch) | |
tree | 6f4c4e477bf4e346dd43bffda0658fcd0896a920 | |
parent | 74d7df175c83e73347114c004ff861aec0572928 (diff) | |
download | rails-0212a41700a4e9cd0a6eb2a0811608ea13f8c5b3.tar.gz rails-0212a41700a4e9cd0a6eb2a0811608ea13f8c5b3.tar.bz2 rails-0212a41700a4e9cd0a6eb2a0811608ea13f8c5b3.zip |
Fix tests not unsubscribing from Notifications.
See https://github.com/rails/rails/blob/master/activesupport/lib/active_support/notifications.rb#L131
4 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/connection_test.rb b/activerecord/test/cases/adapters/mysql2/connection_test.rb index 98febd2d75..57d8b8dd99 100644 --- a/activerecord/test/cases/adapters/mysql2/connection_test.rb +++ b/activerecord/test/cases/adapters/mysql2/connection_test.rb @@ -4,12 +4,12 @@ class MysqlConnectionTest < ActiveRecord::TestCase def setup super @subscriber = SQLSubscriber.new - ActiveSupport::Notifications.subscribe('sql.active_record', @subscriber) + @subscription = ActiveSupport::Notifications.subscribe('sql.active_record', @subscriber) @connection = ActiveRecord::Base.connection end def teardown - ActiveSupport::Notifications.unsubscribe(@subscriber) + ActiveSupport::Notifications.unsubscribe(@subscription) super end diff --git a/activerecord/test/cases/adapters/postgresql/connection_test.rb b/activerecord/test/cases/adapters/postgresql/connection_test.rb index aa4996133f..514ae20e3c 100644 --- a/activerecord/test/cases/adapters/postgresql/connection_test.rb +++ b/activerecord/test/cases/adapters/postgresql/connection_test.rb @@ -8,12 +8,12 @@ module ActiveRecord def setup super @subscriber = SQLSubscriber.new - ActiveSupport::Notifications.subscribe('sql.active_record', @subscriber) + @subscription = ActiveSupport::Notifications.subscribe('sql.active_record', @subscriber) @connection = ActiveRecord::Base.connection end def teardown - ActiveSupport::Notifications.unsubscribe(@subscriber) + ActiveSupport::Notifications.unsubscribe(@subscription) super end diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb index 73cb739b2b..78c6e27ff3 100644 --- a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb @@ -23,7 +23,7 @@ module ActiveRecord eosql @subscriber = SQLSubscriber.new - ActiveSupport::Notifications.subscribe('sql.active_record', @subscriber) + @subscription = ActiveSupport::Notifications.subscribe('sql.active_record', @subscriber) end def test_bad_connection @@ -70,7 +70,7 @@ module ActiveRecord end def teardown - ActiveSupport::Notifications.unsubscribe(@subscriber) + ActiveSupport::Notifications.unsubscribe(@subscription) super end diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb index 24eb91bef9..d4b368fe45 100644 --- a/activerecord/test/cases/bind_parameter_test.rb +++ b/activerecord/test/cases/bind_parameter_test.rb @@ -22,11 +22,11 @@ module ActiveRecord @connection = ActiveRecord::Base.connection @listener = LogListener.new @pk = Topic.columns.find { |c| c.primary } - ActiveSupport::Notifications.subscribe('sql.active_record', @listener) + @subscriber = ActiveSupport::Notifications.subscribe('sql.active_record', @listener) end teardown do - ActiveSupport::Notifications.unsubscribe(@listener) + ActiveSupport::Notifications.unsubscribe(@subscriber) end if ActiveRecord::Base.connection.supports_statement_cache? |