0
+ def test_daylight_savings_time_crossings_backward_start_1day
0
+ with_env_tz 'US/Eastern' do
0
+ # dt: US: 2005 April 3rd 4:18am
0
+ assert_equal Time.local(2005,4,2,4,18,0), Time.local(2005,4,3,4,18,0).ago(1.day), 'dt-1.day=>st'
0
+ assert_equal Time.local(2005,4,1,4,18,0), Time.local(2005,4,2,4,18,0).ago(1.day), 'st-1.day=>st'
0
+ # dt: New Zealand: 2006 October 1st 4:18am
0
+ assert_equal Time.local(2006,9,30,4,18,0), Time.local(2006,10,1,4,18,0).ago(1.day), 'dt-1.day=>st'
0
+ assert_equal Time.local(2006,9,29,4,18,0), Time.local(2006,9,30,4,18,0).ago(1.day), 'st-1.day=>st'
0
+ def test_daylight_savings_time_crossings_backward_end_1day
0
+ with_env_tz 'US/Eastern' do
0
+ # st: US: 2005 October 30th 4:03am
0
+ assert_equal Time.local(2005,10,29,4,3), Time.local(2005,10,30,4,3,0).ago(1.day), 'st-1.day=>dt'
0
+ assert_equal Time.local(2005,10,28,4,3), Time.local(2005,10,29,4,3,0).ago(1.day), 'dt-1.day=>dt'
0
+ # st: New Zealand: 2006 March 19th 4:03am
0
+ assert_equal Time.local(2006,3,18,4,3), Time.local(2006,3,19,4,3,0).ago(1.day), 'st-1.day=>dt'
0
+ assert_equal Time.local(2006,3,17,4,3), Time.local(2006,3,18,4,3,0).ago(1.day), 'dt-1.day=>dt'
0
assert_equal Time.local(2005,2,22,10,10,11), Time.local(2005,2,22,10,10,10).since(1)
0
assert_equal Time.local(2005,2,22,11,10,10), Time.local(2005,2,22,10,10,10).since(3600)
0
+ def test_daylight_savings_time_crossings_forward_start_1day
0
+ with_env_tz 'US/Eastern' do
0
+ # st: US: 2005 April 2nd 7:27pm
0
+ assert_equal Time.local(2005,4,3,19,27,0), Time.local(2005,4,2,19,27,0).since(1.day), 'st+1.day=>dt'
0
+ assert_equal Time.local(2005,4,4,19,27,0), Time.local(2005,4,3,19,27,0).since(1.day), 'dt+1.day=>dt'
0
+ # st: New Zealand: 2006 September 30th 7:27pm
0
+ assert_equal Time.local(2006,10,1,19,27,0), Time.local(2006,9,30,19,27,0).since(1.day), 'st+1.day=>dt'
0
+ assert_equal Time.local(2006,10,2,19,27,0), Time.local(2006,10,1,19,27,0).since(1.day), 'dt+1.day=>dt'
0
def test_daylight_savings_time_crossings_forward_start_tomorrow
0
with_env_tz 'US/Eastern' do
0
# st: US: 2005 April 2nd 7:27pm
0
- def test_daylight_savings_time_crossings_
forward_start_yesterday
0
+ def test_daylight_savings_time_crossings_
backward_start_yesterday
0
with_env_tz 'US/Eastern' do
0
# st: US: 2005 April 2nd 7:27pm
0
assert_equal Time.local(2005,4,2,19,27,0), Time.local(2005,4,3,19,27,0).yesterday, 'dt-1.day=>st'
0
+ def test_daylight_savings_time_crossings_forward_end_1day
0
+ with_env_tz 'US/Eastern' do
0
+ # dt: US: 2005 October 30th 12:45am
0
+ assert_equal Time.local(2005,10,31,0,45,0), Time.local(2005,10,30,0,45,0).since(1.day), 'dt+1.day=>st'
0
+ assert_equal Time.local(2005,11, 1,0,45,0), Time.local(2005,10,31,0,45,0).since(1.day), 'st+1.day=>st'
0
+ # dt: New Zealand: 2006 March 19th 1:45am
0
+ assert_equal Time.local(2006,3,20,1,45,0), Time.local(2006,3,19,1,45,0).since(1.day), 'dt+1.day=>st'
0
+ assert_equal Time.local(2006,3,21,1,45,0), Time.local(2006,3,20,1,45,0).since(1.day), 'st+1.day=>st'
0
def test_daylight_savings_time_crossings_forward_end_tomorrow
0
with_env_tz 'US/Eastern' do
0
# dt: US: 2005 October 30th 12:45am
0
- def test_daylight_savings_time_crossings_
forward_end_yesterday
0
+ def test_daylight_savings_time_crossings_
backward_end_yesterday
0
with_env_tz 'US/Eastern' do
0
# dt: US: 2005 October 30th 12:45am
0
assert_equal Time.local(2005,10,30,0,45,0), Time.local(2005,10,31,0,45,0).yesterday, 'st-1.day=>dt'
Comments
No one has commented yet.