aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/caching_test.rb')
-rw-r--r--activesupport/test/caching_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 7667f11343..892aa97ad7 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -342,3 +342,22 @@ uses_memcached 'memcached backed store' do
include CacheStoreBehavior
end
end
+
+class CacheStoreLoggerTest < ActiveSupport::TestCase
+ def setup
+ @cache = ActiveSupport::Cache.lookup_store(:memory_store)
+
+ @buffer = StringIO.new
+ @cache.logger = Logger.new(@buffer)
+ end
+
+ def test_logging
+ @cache.fetch('foo') { 'bar' }
+ assert @buffer.string.present?
+ end
+
+ def test_mute_logging
+ @cache.mute { @cache.fetch('foo') { 'bar' } }
+ assert @buffer.string.blank?
+ end
+end