Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj committed Jan 3, 2023
1 parent 8906510 commit d8a213c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/rspec/mocks/argument_matchers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def ==(other)
expect(a_double).to receive(:random_call).with(opts)
a_double.random_call(:a => "a", :b => "b")
end.to fail_with do |failure|
expect(failure.message).to match(/received unexpected message :random_call with \(\{:a=>"a", :b=>"b"\}\)/)
expect(failure.message).to include('received unexpected message :random_call with ({:a=>"a", :b=>"b"})')
reset_all
end
end
Expand Down
5 changes: 4 additions & 1 deletion spec/rspec/mocks/matchers/receive_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def kw_args_method(a:, b:); end
dbl = instance_double(TestObject)
expect(dbl).to receive(:kw_args_method).with({a: 1, b: 2})
dbl.kw_args_method(a: 1, b: 2)
}.to fail_with(/received unexpected message :kw_args_method with \(\{:a=>1, :b=>2\}\)/)
}.to fail_with do |failure|
reset_all
expect(failure.message).to include("received unexpected message :kw_args_method with ({:a=>1, :b=>2})")
end
end
else
it "expects to receive keyword args with a hash" do
Expand Down

0 comments on commit d8a213c

Please sign in to comment.