diff options
author | gbuesing <gbuesing@gmail.com> | 2008-05-18 11:15:29 -0500 |
---|---|---|
committer | gbuesing <gbuesing@gmail.com> | 2008-05-18 11:15:29 -0500 |
commit | cde9c09a524a21214ea9cd0f9ee4489e4d185af2 (patch) | |
tree | f3f5e90e0c3e85602c74417b80391dbe2eeea706 /activesupport/test/core_ext | |
parent | e30a263bf1744d0b55d073c7d1087d0d64181d2c (diff) | |
download | rails-cde9c09a524a21214ea9cd0f9ee4489e4d185af2.tar.gz rails-cde9c09a524a21214ea9cd0f9ee4489e4d185af2.tar.bz2 rails-cde9c09a524a21214ea9cd0f9ee4489e4d185af2.zip |
TimeWithZone #+ and #- : ensure overflow to DateTime with Numeric arg
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/time_with_zone_test.rb | 7 |
1 files changed, 7 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 70c393dd46..c373bca88d 100644 --- a/activesupport/test/core_ext/time_with_zone_test.rb +++ b/activesupport/test/core_ext/time_with_zone_test.rb @@ -170,6 +170,13 @@ class TimeWithZoneTest < Test::Unit::TestCase assert_equal DateTime.civil(1999, 12, 31, 19, 0 ,5), (twz + 5).time end end + + def test_plus_when_crossing_time_class_limit + silence_warnings do # silence warnings raised by tzinfo gem + twz = ActiveSupport::TimeWithZone.new(Time.utc(2038, 1, 19), @time_zone) + assert_equal [0, 0, 19, 19, 1, 2038], (twz + 86_400).to_a[0,6] + end + end def test_plus_with_duration silence_warnings do # silence warnings raised by tzinfo gem |