aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-06-21 14:35:14 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-06-21 15:25:28 +0100
commitb5775c2b3efb3ae5ef9074d26f6fc3e302a4f6f0 (patch)
treeab1ed892e04ed605c122e9a42a17286e63c5f1e8 /activesupport/test
parent9f7eaea201b2f408d9effbf82f2731957e284adf (diff)
downloadrails-b5775c2b3efb3ae5ef9074d26f6fc3e302a4f6f0.tar.gz
rails-b5775c2b3efb3ae5ef9074d26f6fc3e302a4f6f0.tar.bz2
rails-b5775c2b3efb3ae5ef9074d26f6fc3e302a4f6f0.zip
Add expiry support File cache store [#1693 state:resolved] [Roman Shterenzon, Pratik Naik]
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/caching_test.rb10
1 files changed, 10 insertions, 0 deletions
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