spec/cron_spec.rb in rufus-scheduler-2.0.13 vs spec/cron_spec.rb in rufus-scheduler-2.0.14

- old
+ new

@@ -35,11 +35,11 @@ job.unschedule seconds.uniq.size.should == seconds.size end - it 'unschedules' do + it 'unschedules (self)' do second = nil job = @s.cron '* * * * * *' do |job| second = job.last.sec @@ -50,9 +50,32 @@ sleep 2 second.should_not == nil job.unschedule + + after = second + + sleep 2 + + second.should == after + end + + it 'unschedules (job)' do + + second = nil + + job = @s.cron '* * * * * *' do |job| + second = job.last.sec + end + + second.should == nil + + sleep 2 + + second.should_not == nil + + @s.unschedule(job) after = second sleep 2