Skip to content

Commit

Permalink
Fix matching stubs with HashExcludingMatcher
Browse files Browse the repository at this point in the history
Stubs using HashExcludingMatcher were not working because body is not being converted to a hash in order to do the matching
  • Loading branch information
lucasarnaud committed Dec 14, 2022
1 parent 833291d commit 5726e10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/webmock/request_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def matches?(body, content_type = "")
matching_body_hashes?(body_as_hash(body, content_type), @pattern, content_type)
elsif (@pattern).is_a?(Array)
matching_body_array?(body_as_hash(body, content_type), @pattern, content_type)
elsif (@pattern).is_a?(WebMock::Matchers::HashIncludingMatcher)
elsif (@pattern).is_a?(WebMock::Matchers::HashArgumentMatcher)
@pattern == body_as_hash(body, content_type)
else
empty_string?(@pattern) && empty_string?(body) ||
Expand Down

0 comments on commit 5726e10

Please sign in to comment.