|
457 | 457 | t0 = Time.utc(2013, 5, 18, 12, 34)
|
458 | 458 | schedule = IceCube::Schedule.new(t0)
|
459 | 459 | schedule.add_recurrence_rule IceCube::Rule.daily
|
460 |
| - previous = schedule.previous_occurrence(t0 + 2 * ONE_DAY) |
461 |
| - previous.should == t0 + ONE_DAY |
| 460 | + previous = schedule.previous_occurrence(t0 + 2 * IceCube::ONE_DAY) |
| 461 | + previous.should == t0 + IceCube::ONE_DAY |
462 | 462 | end
|
463 | 463 |
|
464 | 464 | it 'returns nil given the start time' do
|
|
485 | 485 | t0 = Time.utc(2013, 5, 18, 12, 34)
|
486 | 486 | schedule = IceCube::Schedule.new(t0)
|
487 | 487 | schedule.add_recurrence_rule IceCube::Rule.daily
|
488 |
| - previous = schedule.previous_occurrences(2, t0 + 3 * ONE_DAY) |
489 |
| - previous.should == [t0 + ONE_DAY, t0 + 2 * ONE_DAY] |
| 488 | + previous = schedule.previous_occurrences(2, t0 + 3 * IceCube::ONE_DAY) |
| 489 | + previous.should == [t0 + IceCube::ONE_DAY, t0 + 2 * IceCube::ONE_DAY] |
490 | 490 | end
|
491 | 491 |
|
492 | 492 | it 'limits the returned occurrences to a given count' do
|
493 | 493 | t0 = Time.utc(2013, 5, 18, 12, 34)
|
494 | 494 | schedule = IceCube::Schedule.new(t0)
|
495 | 495 | schedule.add_recurrence_rule IceCube::Rule.daily
|
496 |
| - previous = schedule.previous_occurrences(999, t0 + 2 * ONE_DAY) |
497 |
| - previous.should == [t0, t0 + ONE_DAY] |
| 496 | + previous = schedule.previous_occurrences(999, t0 + 2 * IceCube::ONE_DAY) |
| 497 | + previous.should == [t0, t0 + IceCube::ONE_DAY] |
498 | 498 | end
|
499 | 499 |
|
500 | 500 | it 'returns empty array given the start time' do
|
|
531 | 531 | t1 = Time.utc(2013, 5, 31, 12, 34)
|
532 | 532 | schedule = IceCube::Schedule.new(t0)
|
533 | 533 | schedule.add_recurrence_rule IceCube::Rule.daily.until(t1 + 1)
|
534 |
| - schedule.last(2).should == [t1 - ONE_DAY, t1] |
| 534 | + schedule.last(2).should == [t1 - IceCube::ONE_DAY, t1] |
535 | 535 | end
|
536 | 536 |
|
537 | 537 | it 'raises an error for a non-terminating schedule' do
|
|
0 commit comments