From 7e972d7b0216e10c2029dece1c4a3f0b3b309ef2 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Mon, 2 Oct 2023 11:29:06 -0400 Subject: [PATCH] Use a block for expect to raise_exception This was probably the only way to do it 10 years ago when it was added. --- spec/worker_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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