From b5775c2b3efb3ae5ef9074d26f6fc3e302a4f6f0 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 21 Jun 2009 14:35:14 +0100 Subject: Add expiry support File cache store [#1693 state:resolved] [Roman Shterenzon, Pratik Naik] --- activesupport/test/caching_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activesupport/test') diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 51d04d9388..e6e2205708 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -146,6 +146,16 @@ class FileStoreTest < ActiveSupport::TestCase end include CacheStoreBehavior + + def test_expires_in + @cache.write('foo', 'bar') + cache_read = lambda { @cache.read('foo', :expires_in => 2) } + assert_equal 'bar', cache_read.call + sleep(1) + assert_equal 'bar', cache_read.call + sleep(1) + assert_nil cache_read.call + end end class MemoryStoreTest < ActiveSupport::TestCase -- cgit v1.2.3