зеркало из 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
|
end
|
||||||
|
|
||||||
# Wraps Memcached#delete so that it doesn't raise.
|
# Wraps Memcached#delete so that it doesn't raise.
|
||||||
def delete(key)
|
def delete(key, expiry=0)
|
||||||
super
|
super(key)
|
||||||
rescue NotFound
|
rescue NotFound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,13 @@ class RailsTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
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
|
def test_bracket_accessors
|
||||||
@cache[key] = @value
|
@cache[key] = @value
|
||||||
result = @cache[key]
|
result = @cache[key]
|
||||||
|
|
Загрузка…
Ссылка в новой задаче