spec/error_spec.rb in rufus-scheduler-3.0.7 vs spec/error_spec.rb in rufus-scheduler-3.0.8
- old
+ new
@@ -41,12 +41,12 @@
fail 'argh'
end
sleep 2
- counter.should > 2
- $stderr.string.should match(/argh/)
+ expect(counter).to be > 2
+ expect($stderr.string).to match(/argh/)
end
end
context 'error in callable' do
@@ -67,12 +67,12 @@
@scheduler.every('0.5s', mfh)
sleep 2
- mfh.counter.should > 2
- $stderr.string.should match(/ouch/)
+ expect(mfh.counter).to be > 2
+ expect($stderr.string).to match(/ouch/)
end
end
context 'Rufus::Scheduler#stderr=' do
@@ -84,12 +84,12 @@
fail 'miserably'
end
sleep 0.5
- @scheduler.stderr.string.should match(/intercepted an error/)
- @scheduler.stderr.string.should match(/miserably/)
+ expect(@scheduler.stderr.string).to match(/intercepted an error/)
+ expect(@scheduler.stderr.string).to match(/miserably/)
end
end
context 'error information' do
@@ -104,15 +104,15 @@
sleep 0.5
s = @scheduler.stderr.string
#puts s
- s.should match(/ENV\['TZ'\]:/)
- s.should match(/down\?: false/)
- s.should match(/work_threads: 1/)
- s.should match(/running_jobs: 1/)
- s.should match(/uptime: \d/)
+ expect(s).to match(/ENV\['TZ'\]:/)
+ expect(s).to match(/down\?: false/)
+ expect(s).to match(/work_threads: 1/)
+ expect(s).to match(/running_jobs: 1/)
+ expect(s).to match(/uptime: \d/)
end
end
context 'Rufus::Scheduler#on_error(&block)' do
@@ -130,10 +130,10 @@
fail 'miserably'
end
sleep 0.5
- $message.should == 'Rufus::Scheduler::InJob 0s miserably'
+ expect($message).to eq('Rufus::Scheduler::InJob 0s miserably')
end
end
end