aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/cache/behaviors/local_cache_behavior.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/cache/behaviors/local_cache_behavior.rb')
-rw-r--r--activesupport/test/cache/behaviors/local_cache_behavior.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/cache/behaviors/local_cache_behavior.rb b/activesupport/test/cache/behaviors/local_cache_behavior.rb
index baa38ba6ac..6f5d53c190 100644
--- a/activesupport/test/cache/behaviors/local_cache_behavior.rb
+++ b/activesupport/test/cache/behaviors/local_cache_behavior.rb
@@ -46,6 +46,15 @@ module LocalCacheBehavior
end
end
+ def test_local_cache_of_read_returns_a_copy_of_the_entry
+ @cache.with_local_cache do
+ @cache.write(:foo, type: "bar")
+ value = @cache.read(:foo)
+ assert_equal("bar", value.delete(:type))
+ assert_equal({ type: "bar" }, @cache.read(:foo))
+ end
+ end
+
def test_local_cache_of_read
@cache.write("foo", "bar")
@cache.with_local_cache do