From 2fd3ea0852277cff8b028c6d01a651a6fc616785 Mon Sep 17 00:00:00 2001 From: Vladimir Andrijevik Date: Fri, 8 Jan 2010 13:57:14 -0800 Subject: [PATCH] Drop expires argument from call to @data in MemCacheStore so it works with memcache-client and memcached gems, as advertised --- .../lib/active_support/cache/mem_cache_store.rb | 2 +- activesupport/test/caching_test.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb index d584c9e..d84a62c 100644 --- a/activesupport/lib/active_support/cache/mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/mem_cache_store.rb @@ -91,7 +91,7 @@ module ActiveSupport def delete(key, options = nil) # :nodoc: super do - response = @data.delete(key, expires_in(options)) + response = @data.delete(key) response == Response::DELETED end rescue MemCache::MemCacheError => e diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 00e05f7..d96f8e1 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -333,6 +333,12 @@ uses_memcached 'memcached backed store' do assert_equal 'bat', @cache.read('baz') assert_equal nil, @cache.read('foo') end + + def test_delete_should_only_pass_key_to_data + key = 'foo' + @data.expects(:delete).with(key) + @cache.delete(key) + end end class CompressedMemCacheStore < ActiveSupport::TestCase -- 1.6.5.2