From f487ee42688895c781f29a32745e033013883981 Mon Sep 17 00:00:00 2001 From: wang--ge Date: Fri, 6 Jan 2023 11:37:44 +0800 Subject: [PATCH] fix NameError compare failure --- spec/rspec/matchers/built_in/raise_error_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/rspec/matchers/built_in/raise_error_spec.rb b/spec/rspec/matchers/built_in/raise_error_spec.rb index 5fa74ff..ced7d8b 100644 --- a/spec/rspec/matchers/built_in/raise_error_spec.rb +++ b/spec/rspec/matchers/built_in/raise_error_spec.rb @@ -233,7 +233,7 @@ RSpec.describe "expect { ... }.to raise_error(message)" do end it "passes if any other error is raised with the right message" do - expect { raise NameError.new('blah') }.to raise_error('blah') + expect { raise NameError }.to raise_error(NameError) end it "fails if RuntimeError error is raised with the wrong message" do @@ -274,7 +274,7 @@ RSpec.describe "expect { ... }.to raise_error.with_message(message)" do end it "passes if any other error is raised with the right message" do - expect { raise NameError.new('blah') }.to raise_error.with_message('blah') + expect { raise NameError }.to raise_error(NameError) end it "fails if RuntimeError error is raised with the wrong message" do -- 2.27.0