Skip to content

Commit c677229

Browse files
committed
ActiveSupport::Cache, Part V - change clear override for MemCached
1 parent 2bf5e66 commit c677229

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

activesupport/test/cache/behaviors/local_cache_behavior.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ def test_local_writes_are_persistent_on_the_remote_cache
3030
end
3131

3232
def test_clear_also_clears_local_cache
33-
skip "MemCached Store is failing on this test..."
34-
3533
key = SecureRandom.uuid
3634
@cache.with_local_cache do
3735
@cache.write(key, SecureRandom.alphanumeric)

activesupport/test/cache/stores/mem_cache_store_test.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,15 @@ def after_teardown
7979
# Overrides test from LocalCacheBehavior in order to stub out the cache clear
8080
# and replace it with a delete.
8181
def test_clear_also_clears_local_cache
82-
key = "#{@namespace}:foo"
82+
key = SecureRandom.uuid
83+
cache = lookup_store(raw: true)
8384
client.stub(:flush_all, -> { client.delete(key) }) do
84-
super
85+
cache.with_local_cache do
86+
cache.write(key, SecureRandom.alphanumeric)
87+
cache.clear
88+
assert_nil cache.read(key)
89+
end
90+
assert_nil cache.read(key)
8591
end
8692
end
8793

0 commit comments

Comments
 (0)