diff options
author | Michael Curtis <m.curtis@me.com> | 2009-03-10 12:14:54 -0500 |
---|---|---|
committer | Geoff Buesing <gbuesing@gmail.com> | 2009-03-29 16:15:44 -0500 |
commit | 5a8b481f717470b952ac7eb890f260ea98428153 (patch) | |
tree | 5d7f20143fb24dc78b64e970cb2d3bb14e754e06 /activesupport/test/core_ext/duration_test.rb | |
parent | dd2eb1ea7c34eb6496feaf7e42100f37a8dae76b (diff) | |
download | rails-5a8b481f717470b952ac7eb890f260ea98428153.tar.gz rails-5a8b481f717470b952ac7eb890f260ea98428153.tar.bz2 rails-5a8b481f717470b952ac7eb890f260ea98428153.zip |
Time.local instances: Adding 24.hours across the DST boundary adds 24 hours instead of one day [#2066 state:resolved]
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 ab5a86668e..8954295d10 100644 --- a/activesupport/test/core_ext/duration_test.rb +++ b/activesupport/test/core_ext/duration_test.rb @@ -109,6 +109,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') |