spec/exception_spec.rb in rufus-scheduler-2.0.19 vs spec/exception_spec.rb in rufus-scheduler-2.0.20

- old
+ new

@@ -1,6 +1,5 @@ - # # Specifying rufus-scheduler # # Mon May 4 17:07:17 JST 2009 # @@ -90,8 +89,25 @@ sleep 0.500 sleep 0.500 $j.class.should == Rufus::Scheduler::InJob $e.to_s.should == 'Houston we have a problem' + end + + it 'allow custom exception rescue' do + @s.options[:exception]= StandardError + + job = @s.in 0 do + exit + end + + @e= nil + begin + wait_next_tick + rescue SystemExit => e + @e= e + end + + @e.should_not == nil end end