1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Drop expires argument from call to @data in MemCacheStore so it works with memcache-client and memcached gems, as advertised [#3672 state:resolved]

Signed-off-by: wycats <wycats@gmail.com>
This commit is contained in:
Vladimir Andrijevik 2010-01-08 13:57:14 -08:00 committed by wycats
parent b0967cc5cf
commit edaf92f5ab
2 changed files with 7 additions and 1 deletions

View file

@ -91,7 +91,7 @@ module ActiveSupport
def delete(key, options = nil) # :nodoc: def delete(key, options = nil) # :nodoc:
super do super do
response = @data.delete(key, expires_in(options)) response = @data.delete(key)
response == Response::DELETED response == Response::DELETED
end end
rescue MemCache::MemCacheError => e rescue MemCache::MemCacheError => e

View file

@ -333,6 +333,12 @@ uses_memcached 'memcached backed store' do
assert_equal 'bat', @cache.read('baz') assert_equal 'bat', @cache.read('baz')
assert_equal nil, @cache.read('foo') assert_equal nil, @cache.read('foo')
end end
def test_delete_should_only_pass_key_to_data
key = 'foo'
@data.expects(:delete).with(key)
@cache.delete(key)
end
end end
class CompressedMemCacheStore < ActiveSupport::TestCase class CompressedMemCacheStore < ActiveSupport::TestCase