diff options
author | gbuesing <gbuesing@gmail.com> | 2008-05-08 20:56:38 -0500 |
---|---|---|
committer | gbuesing <gbuesing@gmail.com> | 2008-05-08 20:56:38 -0500 |
commit | fb9bf16e96e2c24d4996327500d8109b5d535e2c (patch) | |
tree | 87d0b30af0901868c5604ee2a50b3a8de5807a14 /activesupport/test | |
parent | 328fada610aa9128386bc4b372d3e0b68aede945 (diff) | |
download | rails-fb9bf16e96e2c24d4996327500d8109b5d535e2c.tar.gz rails-fb9bf16e96e2c24d4996327500d8109b5d535e2c.tar.bz2 rails-fb9bf16e96e2c24d4996327500d8109b5d535e2c.zip |
Time.zone.parse: compatibility with far future date with time zone offset in string. Eliminate creation of additional TimeWithZone instance to determine utc offset.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/time_zone_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index dd70186676..0bfb89b675 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -189,6 +189,15 @@ class TimeZoneTest < Test::Unit::TestCase assert_equal zone, twz.time_zone end end + + def test_parse_far_future_date_with_time_zone_offset_in_string + silence_warnings do # silence warnings raised by tzinfo gem + zone = TimeZone['Eastern Time (US & Canada)'] + twz = zone.parse('2050-12-31 19:00:00 -10:00') # i.e., 2050-01-01 05:00:00 UTC + assert_equal [0,0,0,1,1,2051], twz.to_a[0,6] + assert_equal zone, twz.time_zone + end + end uses_mocha 'TestParseWithIncompleteDate' do def test_parse_with_incomplete_date |