From 94e2001eb5cbea9047270bc2e6904f4f7ace8eaf Mon Sep 17 00:00:00 2001 From: Andrii Malyshko Date: Wed, 25 May 2022 21:12:50 +0300 Subject: [PATCH] Use `a_string_including` instead of a multiline regexp --- .../mocks/verifying_doubles/expected_arg_verification_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb b/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb index dadabface..b2a7c2cc9 100644 --- a/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb +++ b/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb @@ -135,7 +135,7 @@ module Mocks expect(dbl).to receive(:kw_args_method).with(1, :required_arg => 2, :optional_arg => 3) expect do dbl.kw_args_method(1, {:required_arg => 2, :optional_arg => 3}) - end.to fail_with(/expected: \(1, {:optional_arg=>3, :required_arg=>2}\) \(keyword arguments\).*got: \(1, {:optional_arg=>3, :required_arg=>2}\) \(options hash\)/m) + end.to fail_with(a_string_including("expected: (1, {:optional_arg=>3, :required_arg=>2}) (keyword arguments)", "got: (1, {:optional_arg=>3, :required_arg=>2}) (options hash)")) end else it "matches against a hash submitted as a positional argument and received as keyword arguments in Ruby 2.7 or before" do