diff options
-rw-r--r-- | activerecord/test/cases/log_subscriber_test.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/log_subscriber/test_helper.rb | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/log_subscriber_test.rb b/activerecord/test/cases/log_subscriber_test.rb index cde383783b..fa53fc7477 100644 --- a/activerecord/test/cases/log_subscriber_test.rb +++ b/activerecord/test/cases/log_subscriber_test.rb @@ -22,6 +22,7 @@ class LogSubscriberTest < ActiveRecord::TestCase end def test_basic_query_logging + @logger.debugging = true Developer.all wait assert_equal 1, @logger.logged(:debug).size @@ -30,6 +31,7 @@ class LogSubscriberTest < ActiveRecord::TestCase end def test_cached_queries + @logger.debugging = true ActiveRecord::Base.cache do Developer.all Developer.all diff --git a/activesupport/lib/active_support/log_subscriber/test_helper.rb b/activesupport/lib/active_support/log_subscriber/test_helper.rb index a3fb92778b..0f5fc3554b 100644 --- a/activesupport/lib/active_support/log_subscriber/test_helper.rb +++ b/activesupport/lib/active_support/log_subscriber/test_helper.rb @@ -48,9 +48,12 @@ module ActiveSupport class MockLogger attr_reader :flush_count + attr_accessor :debugging + alias :debug? :debugging def initialize @flush_count = 0 + @debugging = false @logged = Hash.new { |h,k| h[k] = [] } end |