aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_ext_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/time_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/time_ext_test.rb20
1 files changed, 8 insertions, 12 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb
index 159b7d8366..c24c8619c6 100644
--- a/activesupport/test/core_ext/time_ext_test.rb
+++ b/activesupport/test/core_ext/time_ext_test.rb
@@ -758,33 +758,29 @@ end
class TimeExtMarshalingTest < Test::Unit::TestCase
def test_marshaling_with_utc_instance
t = Time.utc(2000)
- marshaled = Marshal.dump t
- unmarshaled = Marshal.load marshaled
- assert_equal t, unmarshaled
+ unmarshaled = Marshal.load(Marshal.dump(t))
assert_equal "UTC", unmarshaled.zone
+ assert_equal t, unmarshaled
end
def test_marshaling_with_local_instance
t = Time.local(2000)
- marshaled = Marshal.dump t
- unmarshaled = Marshal.load marshaled
- assert_equal t, unmarshaled
+ unmarshaled = Marshal.load(Marshal.dump(t))
assert_equal t.zone, unmarshaled.zone
+ assert_equal t, unmarshaled
end
def test_marshaling_with_frozen_utc_instance
t = Time.utc(2000).freeze
- marshaled = Marshal.dump t
- unmarshaled = Marshal.load marshaled
- assert_equal t, unmarshaled
+ unmarshaled = Marshal.load(Marshal.dump(t))
assert_equal "UTC", unmarshaled.zone
+ assert_equal t, unmarshaled
end
def test_marshaling_with_frozen_local_instance
t = Time.local(2000).freeze
- marshaled = Marshal.dump t
- unmarshaled = Marshal.load marshaled
- assert_equal t, unmarshaled
+ unmarshaled = Marshal.load(Marshal.dump(t))
assert_equal t.zone, unmarshaled.zone
+ assert_equal t, unmarshaled
end
end