diff --git a/spec/worker_spec.rb b/spec/worker_spec.rb index 1ce08ce99..eb525ede0 100644 --- a/spec/worker_spec.rb +++ b/spec/worker_spec.rb @@ -106,7 +106,7 @@ expect(Delayed::Job).to receive(:reserve).exactly(10).times.and_raise(Exception) worker = Delayed::Worker.new 9.times { worker.work_off } - expect(lambda { worker.work_off }).to raise_exception Delayed::FatalBackendError + expect { worker.work_off }.to raise_exception Delayed::FatalBackendError end it 'allows the backend to attempt recovery from reservation errors' do