Skip to content

Commit

Permalink
Use a block for expect to raise_exception
Browse files Browse the repository at this point in the history
This was probably the only way to do it 10 years ago when it was added.
  • Loading branch information
albus522 committed Oct 2, 2023
1 parent 6a1c712 commit 7e972d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e972d7

Please sign in to comment.