spec/exception_spec.rb in rufus-scheduler-2.0.6 vs spec/exception_spec.rb in rufus-scheduler-2.0.7
- old
+ new
@@ -3,23 +3,23 @@
# Specifying rufus-scheduler
#
# Mon May 4 17:07:17 JST 2009
#
-require File.dirname(__FILE__) + '/spec_base'
+require File.join(File.dirname(__FILE__), '/spec_base')
describe SCHEDULER_CLASS do
- before do
+ before(:each) do
@s = start_scheduler
end
- after do
+ after(:each) do
stop_scheduler(@s)
end
- it 'should emit exception messages to stdout' do
+ it 'emits exception messages to stdout' do
require 'stringio' unless defined?(StringIO) # ruby 1.9
stdout = $stdout
s = StringIO.new
@@ -32,46 +32,45 @@
sleep 0.500
sleep 0.500
$stdout = stdout
s.close
- s.string.should.match(/Houston we have a problem/)
+ s.string.should match(/Houston we have a problem/)
end
- it 'should accept custom handling of exceptions' do
+ it 'accepts custom handling of exceptions' do
$job = nil
- def @s.handle_exception (j, e)
+ def @s.handle_exception(j, e)
$job = j
end
@s.in 0.400 do
raise 'Houston we have a problem'
end
sleep 0.500
sleep 0.500
- $job.class.should.equal(Rufus::Scheduler::InJob)
+ $job.class.should == Rufus::Scheduler::InJob
end
- it 'should accept overriding #log_exception' do
+ it 'accepts overriding #log_exception' do
$e = nil
- def @s.log_exception (e)
+ def @s.log_exception(e)
$e = e
end
@s.in 0.400 do
raise 'Houston we have a problem'
end
sleep 0.500
sleep 0.500
- $e.to_s.should.equal('Houston we have a problem')
+ $e.to_s.should == 'Houston we have a problem'
end
-
end