aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index c93d6157e7..c7b71f4ffe 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -209,6 +209,14 @@ uses_tzinfo 'TimeWithZoneTest' do
assert_instance_of ActiveSupport::TimeWithZone, @twz.months_since(1)
assert_equal Time.utc(2000, 1, 31, 19, 0 ,0), @twz.months_since(1).time
end
+
+ def test_marshal_dump_and_load
+ marshal_str = Marshal.dump(@twz)
+ mtime = Marshal.load(marshal_str)
+ assert_equal Time.utc(2000, 1, 1, 0), mtime.utc
+ assert_equal TimeZone['Eastern Time (US & Canada)'], mtime.time_zone
+ assert_equal Time.utc(1999, 12, 31, 19), mtime.time
+ end
def test_method_missing_with_non_time_return_value
assert_equal 1999, @twz.year