diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-10-09 15:03:18 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-10-09 15:03:18 +0100 |
commit | 987d501182971c1e6cdf8acb748635d14cf0c341 (patch) | |
tree | d6fb084a26d50230e592e29f02a207460d37c869 /activesupport/test | |
parent | 16a48a95e3cb0044587df7b0e83b017a94506739 (diff) | |
download | rails-987d501182971c1e6cdf8acb748635d14cf0c341.tar.gz rails-987d501182971c1e6cdf8acb748635d14cf0c341.tar.bz2 rails-987d501182971c1e6cdf8acb748635d14cf0c341.zip |
Mute log info coming from the local_cache strategy
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 19 |
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 |