aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-11-07 18:17:08 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2015-11-07 18:17:08 +0100
commit5336a6333cfd5eba8bcbe4e28a1a875b786146f4 (patch)
treebcfb189775a0db1da205e39974b4afc20c5d3b94 /activesupport/test
parent24bddfc542cf218e395029db3ece4502ae79eb3d (diff)
parente401a6bb251d382901d0e4e80b09545b29b16a89 (diff)
downloadrails-5336a6333cfd5eba8bcbe4e28a1a875b786146f4.tar.gz
rails-5336a6333cfd5eba8bcbe4e28a1a875b786146f4.tar.bz2
rails-5336a6333cfd5eba8bcbe4e28a1a875b786146f4.zip
Merge pull request #22197 from grosser/grosser/fetch
do not override fetch on local cache
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/caching_test.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 94e73b6df3..3629f5e64b 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -633,6 +633,13 @@ module LocalCacheBehavior
end
end
+ def test_local_cache_fetch
+ @cache.with_local_cache do
+ @cache.send(:local_cache).write 'foo', 'bar'
+ assert_equal 'bar', @cache.send(:local_cache).fetch('foo')
+ end
+ end
+
def test_local_cache_of_write_nil
@cache.with_local_cache do
assert @cache.write('foo', nil)
@@ -1102,11 +1109,11 @@ class CacheStoreLoggerTest < ActiveSupport::TestCase
def test_log_with_proc_namespace
proc = Proc.new do
"proc_namespace"
- end
+ 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?