From fed7d180a2265b9c9b1f3de4bf93e69d03d0c230 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Mon, 20 May 2024 14:18:23 -0700 Subject: [PATCH] Fix ignored block issue in model hooks spec Previously, this wasn't testing what it should, since the block was ignored. Caught by the unused block warning in Ruby 3.4. --- spec/model/hooks_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/model/hooks_spec.rb b/spec/model/hooks_spec.rb index dfa51caebb..9ccd73292a 100644 --- a/spec/model/hooks_spec.rb +++ b/spec/model/hooks_spec.rb @@ -109,7 +109,8 @@ def after_save it "#save should have a raised exception reference the model instance" do @c.send(:define_method, :before_save){cancel_action} - proc{@c.create(:x => 2233)}.must_raise(Sequel::HookFailed){|e| e.model.must_equal @c.load(:x=>2233)} + e = proc{@c.create(:x => 2233)}.must_raise(Sequel::HookFailed) + e.model.must_equal @c.load(:x=>2233) DB.sqls.must_equal [] end end