aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-10-10 17:15:11 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-10-10 17:15:11 +0100
commit66ee2654ff243f03595a402fa15e1eea1b5b45be (patch)
tree3f1055e03082f0c767719e8cba5155e4207779e0 /activesupport/test/caching_test.rb
parentdd2779e1b83b4d867d47dd286ec0c919f5df12a9 (diff)
parentb9ce8216fa849a47ad0b0f99fa510e226a23c12e (diff)
downloadrails-66ee2654ff243f03595a402fa15e1eea1b5b45be.tar.gz
rails-66ee2654ff243f03595a402fa15e1eea1b5b45be.tar.bz2
rails-66ee2654ff243f03595a402fa15e1eea1b5b45be.zip
Merge commit 'mainstream/master'
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