diff options
Diffstat (limited to 'activesupport/test/caching_test.rb')
-rw-r--r-- | activesupport/test/caching_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 6db1746672..243648d7f6 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -608,6 +608,18 @@ class FileStoreTest < ActiveSupport::TestCase ActiveSupport::Cache::FileStore.new('/test/cache/directory').delete_matched(/does_not_exist/) end end + + def test_cleanup_removes_all_expired_entries + time = Time.now + @cache.write('foo', 'bar', expires_in: 10) + @cache.write('baz', 'qux') + @cache.write('quux', 'corge', expires_in: 20) + Time.stubs(:now).returns(time + 15) + @cache.cleanup + assert !@cache.exist?('foo') + assert @cache.exist?('baz') + assert @cache.exist?('quux') + end end class MemoryStoreTest < ActiveSupport::TestCase |