spec/job_repeat_spec.rb in rufus-scheduler-3.0.1 vs spec/job_repeat_spec.rb in rufus-scheduler-3.0.2
- old
+ new
@@ -229,19 +229,24 @@
end
it 'unschedules the job after the last_at time' do
t = Time.now + 2
+
counter = 0
+ tt = nil
job =
@scheduler.schedule_every '0.5s', :last => t do
counter = counter + 1
+ tt = Time.now
end
sleep 3
- counter.should == 3
+ #counter.should == 3
+ [ 3, 4 ].should include(counter)
+ tt.should < t
@scheduler.jobs.should_not include(job)
end
it 'accepts a time string' do