| | 230 | def test_daylight_savings_time_crossings_forward_start_tomorrow |
|---|
| | 231 | with_env_tz 'US/Eastern' do |
|---|
| | 232 | # st: US: 2005 April 2nd 7:27pm |
|---|
| | 233 | assert_equal Time.local(2005,4,3,19,27,0), Time.local(2005,4,2,19,27,0).tomorrow, 'st+1.day=>dt' |
|---|
| | 234 | assert_equal Time.local(2005,4,4,19,27,0), Time.local(2005,4,3,19,27,0).tomorrow, 'dt+1.day=>dt' |
|---|
| | 235 | end |
|---|
| | 236 | with_env_tz 'NZ' do |
|---|
| | 237 | # st: New Zealand: 2006 September 30th 7:27pm |
|---|
| | 238 | assert_equal Time.local(2006,10,1,19,27,0), Time.local(2006,9,30,19,27,0).tomorrow, 'st+1.day=>dt' |
|---|
| | 239 | assert_equal Time.local(2006,10,2,19,27,0), Time.local(2006,10,1,19,27,0).tomorrow, 'dt+1.day=>dt' |
|---|
| | 240 | end |
|---|
| | 241 | end |
|---|
| | 242 | |
|---|
| | 243 | def test_daylight_savings_time_crossings_forward_start_yesterday |
|---|
| | 244 | with_env_tz 'US/Eastern' do |
|---|
| | 245 | # st: US: 2005 April 2nd 7:27pm |
|---|
| | 246 | assert_equal Time.local(2005,4,2,19,27,0), Time.local(2005,4,3,19,27,0).yesterday, 'dt-1.day=>st' |
|---|
| | 247 | assert_equal Time.local(2005,4,3,19,27,0), Time.local(2005,4,4,19,27,0).yesterday, 'dt-1.day=>dt' |
|---|
| | 248 | end |
|---|
| | 249 | with_env_tz 'NZ' do |
|---|
| | 250 | # st: New Zealand: 2006 September 30th 7:27pm |
|---|
| | 251 | assert_equal Time.local(2006,9,30,19,27,0), Time.local(2006,10,1,19,27,0).yesterday, 'dt-1.day=>st' |
|---|
| | 252 | assert_equal Time.local(2006,10,1,19,27,0), Time.local(2006,10,2,19,27,0).yesterday, 'dt-1.day=>dt' |
|---|
| | 253 | end |
|---|
| | 254 | end |
|---|
| | 255 | |
|---|
| 238 | 264 | assert_equal Time.local(2006,3,20,1,45,0), Time.local(2006,3,19,1,45,0).since(86400), 'dt+1.day=>st' |
|---|
| 239 | 265 | assert_equal Time.local(2006,3,21,1,45,0), Time.local(2006,3,20,1,45,0).since(86400), 'st+1.day=>st' |
|---|
| | 266 | end |
|---|
| | 267 | end |
|---|
| | 268 | |
|---|
| | 269 | def test_daylight_savings_time_crossings_forward_end_tomorrow |
|---|
| | 270 | with_env_tz 'US/Eastern' do |
|---|
| | 271 | # dt: US: 2005 October 30th 12:45am |
|---|
| | 272 | assert_equal Time.local(2005,10,31,0,45,0), Time.local(2005,10,30,0,45,0).tomorrow, 'dt+1.day=>st' |
|---|
| | 273 | assert_equal Time.local(2005,11, 1,0,45,0), Time.local(2005,10,31,0,45,0).tomorrow, 'st+1.day=>st' |
|---|
| | 274 | end |
|---|
| | 275 | with_env_tz 'NZ' do |
|---|
| | 276 | # dt: New Zealand: 2006 March 19th 1:45am |
|---|
| | 277 | assert_equal Time.local(2006,3,20,1,45,0), Time.local(2006,3,19,1,45,0).tomorrow, 'dt+1.day=>st' |
|---|
| | 278 | assert_equal Time.local(2006,3,21,1,45,0), Time.local(2006,3,20,1,45,0).tomorrow, 'st+1.day=>st' |
|---|
| | 279 | end |
|---|
| | 280 | end |
|---|
| | 281 | |
|---|
| | 282 | def test_daylight_savings_time_crossings_forward_end_yesterday |
|---|
| | 283 | with_env_tz 'US/Eastern' do |
|---|
| | 284 | # dt: US: 2005 October 30th 12:45am |
|---|
| | 285 | assert_equal Time.local(2005,10,30,0,45,0), Time.local(2005,10,31,0,45,0).yesterday, 'st-1.day=>dt' |
|---|
| | 286 | assert_equal Time.local(2005,10, 31,0,45,0), Time.local(2005,11,1,0,45,0).yesterday, 'st-1.day=>st' |
|---|
| | 287 | end |
|---|
| | 288 | with_env_tz 'NZ' do |
|---|
| | 289 | # dt: New Zealand: 2006 March 19th 1:45am |
|---|
| | 290 | assert_equal Time.local(2006,3,19,1,45,0), Time.local(2006,3,20,1,45,0).yesterday, 'st-1.day=>dt' |
|---|
| | 291 | assert_equal Time.local(2006,3,20,1,45,0), Time.local(2006,3,21,1,45,0).yesterday, 'st-1.day=>st' |
|---|