diff options
Diffstat (limited to 'activesupport/test/core_ext/duration_test.rb')
-rw-r--r-- | activesupport/test/core_ext/duration_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb index 0e23c5c2dd..d4a4627e3e 100644 --- a/activesupport/test/core_ext/duration_test.rb +++ b/activesupport/test/core_ext/duration_test.rb @@ -89,6 +89,18 @@ class DurationTest < ActiveSupport::TestCase ensure Time.zone_default = nil end + + def test_adding_hours_across_dst_boundary + with_env_tz 'CET' do + assert_equal Time.local(2009,3,29,0,0,0) + 24.hours, Time.local(2009,3,30,1,0,0) + end + end + + def test_adding_day_across_dst_boundary + with_env_tz 'CET' do + assert_equal Time.local(2009,3,29,0,0,0) + 1.day, Time.local(2009,3,30,0,0,0) + end + end protected def with_env_tz(new_tz = 'US/Eastern') |