aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-03-28 04:35:48 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-03-28 04:35:48 +0000
commitc62db052a0c188c405ad97abec9dd2cec2b9b1d8 (patch)
treec71dbe96c414b17fb1a68e0951adc7bb3b0dbb59 /activesupport/test
parent59183eec6f8d3e5d1ac5046dbd4f5cefc7041256 (diff)
downloadrails-c62db052a0c188c405ad97abec9dd2cec2b9b1d8.tar.gz
rails-c62db052a0c188c405ad97abec9dd2cec2b9b1d8.tar.bz2
rails-c62db052a0c188c405ad97abec9dd2cec2b9b1d8.zip
config.time_zone and TimeWithZone#marshal_load accept tzinfo/Olson identifiers
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9108 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb11
1 files changed, 11 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 f20484666e..a1776117df 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -312,6 +312,17 @@ uses_tzinfo 'TimeWithZoneTest' do
assert_equal Time.utc(1999, 12, 31, 19), mtime.time
end
end
+
+ def test_marshal_dump_and_load_with_tzinfo_identifier
+ silence_warnings do # silence warnings raised by tzinfo gem
+ twz = ActiveSupport::TimeWithZone.new(@utc, TZInfo::Timezone.get('America/New_York'))
+ marshal_str = Marshal.dump(twz)
+ mtime = Marshal.load(marshal_str)
+ assert_equal Time.utc(2000, 1, 1, 0), mtime.utc
+ assert_equal 'America/New_York', mtime.time_zone.name
+ assert_equal Time.utc(1999, 12, 31, 19), mtime.time
+ end
+ end
def test_method_missing_with_non_time_return_value
silence_warnings do # silence warnings raised by tzinfo gem