Permalink
Browse files

Merge pull request #2393 from bdurand/fix_cache_read_multi

Fix ArgumentError in ActiveSupport::Cache::CacheStore.read_multi
  • Loading branch information...
1 parent 564d39e commit a173bb328b267fec2bdd9c9838ff9e2265bb02f6 @spastorino spastorino committed Aug 1, 2011
Showing with 9 additions and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/cache.rb
  2. +8 −0 activesupport/test/caching_test.rb
@@ -345,7 +345,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
@@ -194,6 +194,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)

0 comments on commit a173bb3

Please sign in to comment.