зеркало из https://github.com/github/memcached.git
Conform to ActiveSupport::Cache#delete's interface in Memcached::Rails.
This commit is contained in:
Родитель
74ba887614
Коммит
5b4b808cd0
|
@ -76,8 +76,8 @@ class Memcached
|
|||
end
|
||||
|
||||
# Wraps Memcached#delete so that it doesn't raise.
|
||||
def delete(key)
|
||||
super
|
||||
def delete(key, expiry=0)
|
||||
super(key)
|
||||
rescue NotFound
|
||||
end
|
||||
|
||||
|
|
|
@ -41,6 +41,13 @@ class RailsTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_delete_with_two_arguments
|
||||
assert_nothing_raised do
|
||||
@cache.delete(key, 5)
|
||||
assert_nil(@cache.get(key))
|
||||
end
|
||||
end
|
||||
|
||||
def test_bracket_accessors
|
||||
@cache[key] = @value
|
||||
result = @cache[key]
|
||||
|
|
Загрузка…
Ссылка в новой задаче