diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-30 09:44:54 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-30 09:44:54 -0600 |
commit | 6c61ae816ad7326e510a8f019cadc6db4cc9dae0 (patch) | |
tree | d03570d9227a10be2ac8e72b78ac085e002a4ac0 /activesupport/test | |
parent | e038975c29aa883cb9ac5472cdb0ea9319158121 (diff) | |
parent | f654d658f2dab5f4dcc42b2d0c308b4d806dc491 (diff) | |
download | rails-6c61ae816ad7326e510a8f019cadc6db4cc9dae0.tar.gz rails-6c61ae816ad7326e510a8f019cadc6db4cc9dae0.tar.bz2 rails-6c61ae816ad7326e510a8f019cadc6db4cc9dae0.zip |
Merge pull request #11872 from AvnerCohen/log_namespace
When testing cache issues, it is useful to log the actual key, including namespace
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index fb52613a23..854fcce4ef 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -1086,6 +1086,19 @@ class CacheStoreLoggerTest < ActiveSupport::TestCase assert @buffer.string.present? end + def test_log_with_string_namespace + @cache.fetch('foo', {namespace: 'string_namespace'}) { 'bar' } + assert_match %r{string_namespace:foo}, @buffer.string + end + + def test_log_with_proc_namespace + proc = Proc.new do + "proc_namespace" + end + @cache.fetch('foo', {:namespace => proc}) { 'bar' } + assert_match %r{proc_namespace:foo}, @buffer.string + end + def test_mute_logging @cache.mute { @cache.fetch('foo') { 'bar' } } assert @buffer.string.blank? |