Permalink
Browse files

Fix weird timing issue in test due to using Time.now

  • Loading branch information...
1 parent 7073d54 commit 719bf5ba91e1bd2bd97b96f285dfb73e6caf9589 @seejohnrun committed Oct 12, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 spec/examples/to_yaml_spec.rb
@@ -235,10 +235,11 @@
end
it 'should work with occurs_on and TimeWithZone' do
+ start_time = Time.zone.local(2012, 7, 15, 12, 0, 0)
pacific_time = 'Pacific Time (US & Canada)'
Time.zone = pacific_time
- schedule = IceCube::Schedule.new(Time.zone.now)
- schedule.add_recurrence_time Time.zone.now + 7 * IceCube::ONE_DAY
+ schedule = IceCube::Schedule.new(start_time)
+ schedule.add_recurrence_time start_time + 7 * IceCube::ONE_DAY
schedule.occurs_on?(schedule.start_time.to_date + 6).should be(false)
schedule.occurs_on?(schedule.start_time.to_date + 7).should be(true)
schedule.occurs_on?(schedule.start_time.to_date + 8).should be(false)

0 comments on commit 719bf5b

Please sign in to comment.