diff options
author | Sam Ruby <rubys@intertwingly.net> | 2013-04-16 13:18:52 -0400 |
---|---|---|
committer | Sam Ruby <rubys@intertwingly.net> | 2013-04-16 13:18:52 -0400 |
commit | 8efc87c14ed6077897fb2437fb2edf7b03e08ebb (patch) | |
tree | 2972d010daf67d862ad28bba4cd39824d5320533 /activesupport/test | |
parent | 0513f6ca9c43f475ddad97037ea8f42705147bd8 (diff) | |
download | rails-8efc87c14ed6077897fb2437fb2edf7b03e08ebb.tar.gz rails-8efc87c14ed6077897fb2437fb2edf7b03e08ebb.tar.bz2 rails-8efc87c14ed6077897fb2437fb2edf7b03e08ebb.zip |
switch (and lazily convert) ivar names to 3.x
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 31 |
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 |