Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix ArgumentError in ActiveSupport::Cache::CacheStore.read_multi #2393

Merged
merged 1 commit into from Aug 1, 2011
Jump to file or symbol
Failed to load files and symbols.
+9 −1
Split
@@ -347,7 +347,7 @@ def read_multi(*names)
entry = read_entry(key, options)
if entry
if entry.expired?
- delete_entry(key)
+ delete_entry(key, options)
else
results[name] = entry.value
end
@@ -199,6 +199,14 @@ def test_read_multi
@cache.write('fud', 'biz')
assert_equal({"foo" => "bar", "fu" => "baz"}, @cache.read_multi('foo', 'fu'))
end
+
+ def test_read_multi_with_expires
+ @cache.write('foo', 'bar', :expires_in => 0.001)
+ @cache.write('fu', 'baz')
+ @cache.write('fud', 'biz')
+ sleep(0.002)
+ assert_equal({"fu" => "baz"}, @cache.read_multi('foo', 'fu'))
+ end
def test_read_and_write_compressed_small_data
@cache.write('foo', 'bar', :compress => true)