aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2013-04-16 15:14:11 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2013-04-16 15:14:11 -0700
commit46287d6ada3a6b0ab9a7eb371297bf18fb8b74bd (patch)
tree5a4010cbafb3cbbd680c09c7346c9b2cffc08111 /activesupport/test
parent169273227184f3bc1fc85ba61f76cbedfcfb3338 (diff)
parent8efc87c14ed6077897fb2437fb2edf7b03e08ebb (diff)
downloadrails-46287d6ada3a6b0ab9a7eb371297bf18fb8b74bd.tar.gz
rails-46287d6ada3a6b0ab9a7eb371297bf18fb8b74bd.tar.bz2
rails-46287d6ada3a6b0ab9a7eb371297bf18fb8b74bd.zip
Merge pull request #10239 from rubys/cache_entry_conversion_problems
switch (and lazily convert) ivar names to 3.x
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/caching_test.rb31
1 files changed, 15 insertions, 16 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 571be5f296..bcc200cf33 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -943,29 +943,28 @@ class CacheEntryTest < ActiveSupport::TestCase
assert_equal value.bytesize, entry.size
end
- def test_restoring_version_3_entries
- version_3_entry = ActiveSupport::Cache::Entry.allocate
- version_3_entry.instance_variable_set(:@value, "hello")
- version_3_entry.instance_variable_set(:@created_at, Time.now - 60)
- entry = Marshal.load(Marshal.dump(version_3_entry))
+ def test_restoring_version_4beta1_entries
+ version_4beta1_entry = ActiveSupport::Cache::Entry.allocate
+ version_4beta1_entry.instance_variable_set(:@v, "hello")
+ version_4beta1_entry.instance_variable_set(:@x, Time.now.to_i + 60)
+ entry = Marshal.load(Marshal.dump(version_4beta1_entry))
assert_equal "hello", entry.value
assert_equal false, entry.expired?
end
- def test_restoring_compressed_version_3_entries
- version_3_entry = ActiveSupport::Cache::Entry.allocate
- version_3_entry.instance_variable_set(:@value, Zlib::Deflate.deflate(Marshal.dump("hello")))
- version_3_entry.instance_variable_set(:@compressed, true)
- entry = Marshal.load(Marshal.dump(version_3_entry))
+ def test_restoring_compressed_version_4beta1_entries
+ version_4beta1_entry = ActiveSupport::Cache::Entry.allocate
+ version_4beta1_entry.instance_variable_set(:@v, Zlib::Deflate.deflate(Marshal.dump("hello")))
+ version_4beta1_entry.instance_variable_set(:@c, true)
+ entry = Marshal.load(Marshal.dump(version_4beta1_entry))
assert_equal "hello", entry.value
end
- def test_restoring_expired_version_3_entries
- version_3_entry = ActiveSupport::Cache::Entry.allocate
- version_3_entry.instance_variable_set(:@value, "hello")
- version_3_entry.instance_variable_set(:@created_at, Time.now - 60)
- version_3_entry.instance_variable_set(:@expires_in, 58.9)
- entry = Marshal.load(Marshal.dump(version_3_entry))
+ def test_restoring_expired_version_4beta1_entries
+ version_4beta1_entry = ActiveSupport::Cache::Entry.allocate
+ version_4beta1_entry.instance_variable_set(:@v, "hello")
+ version_4beta1_entry.instance_variable_set(:@x, Time.now.to_i - 1)
+ entry = Marshal.load(Marshal.dump(version_4beta1_entry))
assert_equal "hello", entry.value
assert_equal true, entry.expired?
end