diff options
author | Dingding Ye <yedingding@gmail.com> | 2011-06-10 01:15:37 +0800 |
---|---|---|
committer | Dingding Ye <yedingding@gmail.com> | 2011-06-10 01:15:37 +0800 |
commit | c2aacdf2eb833bc16b71530732bded1c8c7ef6f6 (patch) | |
tree | adc0dbdd97927a2fc8dcd72421f872d8d986591d /activesupport/test | |
parent | 834bebf9cc5acbf2c6662d1e5458a2726d305341 (diff) | |
download | rails-c2aacdf2eb833bc16b71530732bded1c8c7ef6f6.tar.gz rails-c2aacdf2eb833bc16b71530732bded1c8c7ef6f6.tar.bz2 rails-c2aacdf2eb833bc16b71530732bded1c8c7ef6f6.zip |
MemcacheStore: deserialize the entry reading from local_cache when using raw
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index ed5ccb44de..8773599941 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -630,7 +630,14 @@ uses_memcached 'memcached backed store' do cache.write("foo", 2) assert_equal "2", cache.read("foo") end - + + def test_raw_values_with_marshal + cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true) + cache.clear + cache.write("foo", Marshal.dump([])) + assert_equal [], cache.read("foo") + end + def test_local_cache_raw_values cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true) cache.clear @@ -639,6 +646,15 @@ uses_memcached 'memcached backed store' do assert_equal "2", cache.read("foo") end end + + def test_local_cache_raw_values_with_marshal + cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true) + cache.clear + cache.with_local_cache do + cache.write("foo", Marshal.dump([])) + assert_equal [], cache.read("foo") + end + end end end |