aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/caching_test.rb')
-rw-r--r--activesupport/test/caching_test.rb49
1 files changed, 5 insertions, 44 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 476d55fffd..498127e5bc 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -188,6 +188,11 @@ module CacheStoreBehavior
assert_equal nil, @cache.read('foo')
end
+ def test_should_read_and_write_false
+ assert_equal true, @cache.write('foo', false)
+ assert_equal false, @cache.read('foo')
+ end
+
def test_read_multi
@cache.write('foo', 'bar')
@cache.write('fu', 'baz')
@@ -531,26 +536,6 @@ class FileStoreTest < ActiveSupport::TestCase
include CacheDeleteMatchedBehavior
include CacheIncrementDecrementBehavior
- def test_deprecated_expires_in_on_read
- ActiveSupport::Deprecation.silence do
- old_cache = ActiveSupport::Cache.lookup_store(:file_store, cache_dir)
-
- time = Time.local(2008, 4, 24)
- Time.stubs(:now).returns(time)
-
- old_cache.write("foo", "bar")
- assert_equal 'bar', old_cache.read('foo', :expires_in => 60)
-
- Time.stubs(:now).returns(time + 30)
- assert_equal 'bar', old_cache.read('foo', :expires_in => 60)
-
- Time.stubs(:now).returns(time + 61)
- assert_equal 'bar', old_cache.read('foo')
- assert_nil old_cache.read('foo', :expires_in => 60)
- assert_nil old_cache.read('foo')
- end
- end
-
def test_key_transformation
key = @cache.send(:key_file_path, "views/index?id=1")
assert_equal "views/index?id=1", @cache.send(:file_path_key, key)
@@ -628,18 +613,6 @@ class MemoryStoreTest < ActiveSupport::TestCase
end
end
-class SynchronizedStoreTest < ActiveSupport::TestCase
- def setup
- ActiveSupport::Deprecation.silence do
- @cache = ActiveSupport::Cache.lookup_store(:memory_store, :expires_in => 60)
- end
- end
-
- include CacheStoreBehavior
- include CacheDeleteMatchedBehavior
- include CacheIncrementDecrementBehavior
-end
-
uses_memcached 'memcached backed store' do
class MemCacheStoreTest < ActiveSupport::TestCase
def setup
@@ -672,18 +645,6 @@ uses_memcached 'memcached backed store' do
end
end
end
-
- class CompressedMemCacheStore < ActiveSupport::TestCase
- def setup
- ActiveSupport::Deprecation.silence do
- @cache = ActiveSupport::Cache.lookup_store(:compressed_mem_cache_store, :expires_in => 60)
- @cache.clear
- end
- end
-
- include CacheStoreBehavior
- include CacheIncrementDecrementBehavior
- end
end
class CacheStoreLoggerTest < ActiveSupport::TestCase