aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/cache
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/cache')
-rw-r--r--activesupport/test/cache/behaviors/cache_store_behavior.rb1
-rw-r--r--activesupport/test/cache/behaviors/local_cache_behavior.rb9
-rw-r--r--activesupport/test/cache/cache_key_test.rb1
-rw-r--r--activesupport/test/cache/stores/mem_cache_store_test.rb1
-rw-r--r--activesupport/test/cache/stores/redis_cache_store_test.rb2
5 files changed, 9 insertions, 5 deletions
diff --git a/activesupport/test/cache/behaviors/cache_store_behavior.rb b/activesupport/test/cache/behaviors/cache_store_behavior.rb
index a696760bb2..e6f014e08d 100644
--- a/activesupport/test/cache/behaviors/cache_store_behavior.rb
+++ b/activesupport/test/cache/behaviors/cache_store_behavior.rb
@@ -507,7 +507,6 @@ module CacheStoreBehavior
end
private
-
def assert_compressed(value, **options)
assert_compression(true, value, **options)
end
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
diff --git a/activesupport/test/cache/cache_key_test.rb b/activesupport/test/cache/cache_key_test.rb
index c2240d03c2..f0cd991553 100644
--- a/activesupport/test/cache/cache_key_test.rb
+++ b/activesupport/test/cache/cache_key_test.rb
@@ -79,7 +79,6 @@ class CacheKeyTest < ActiveSupport::TestCase
end
private
-
def with_env(kv)
old_values = {}
kv.each { |key, value| old_values[key], ENV[key] = ENV[key], value }
diff --git a/activesupport/test/cache/stores/mem_cache_store_test.rb b/activesupport/test/cache/stores/mem_cache_store_test.rb
index 0e472f5a1a..3917d14d1c 100644
--- a/activesupport/test/cache/stores/mem_cache_store_test.rb
+++ b/activesupport/test/cache/stores/mem_cache_store_test.rb
@@ -113,7 +113,6 @@ class MemCacheStoreTest < ActiveSupport::TestCase
end
private
-
def store
[:mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"]
end
diff --git a/activesupport/test/cache/stores/redis_cache_store_test.rb b/activesupport/test/cache/stores/redis_cache_store_test.rb
index 790534cd3c..a2177e0476 100644
--- a/activesupport/test/cache/stores/redis_cache_store_test.rb
+++ b/activesupport/test/cache/stores/redis_cache_store_test.rb
@@ -191,7 +191,6 @@ module ActiveSupport::Cache::RedisCacheStoreTests
include ConnectionPoolBehavior
private
-
def store
[:redis_cache_store]
end
@@ -238,7 +237,6 @@ module ActiveSupport::Cache::RedisCacheStoreTests
include FailureSafetyBehavior
private
-
def emulating_unavailability
old_client = Redis.send(:remove_const, :Client)
Redis.const_set(:Client, UnavailableRedisClient)