Skip to content

Commit 7e972d7

Browse files
committed
Use a block for expect to raise_exception
This was probably the only way to do it 10 years ago when it was added.
1 parent 6a1c712 commit 7e972d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/worker_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
expect(Delayed::Job).to receive(:reserve).exactly(10).times.and_raise(Exception)
107107
worker = Delayed::Worker.new
108108
9.times { worker.work_off }
109-
expect(lambda { worker.work_off }).to raise_exception Delayed::FatalBackendError
109+
expect { worker.work_off }.to raise_exception Delayed::FatalBackendError
110110
end
111111

112112
it 'allows the backend to attempt recovery from reservation errors' do

0 commit comments

Comments
 (0)