From 5726e10d8d1c7801608ecdb5d94d842fbd234342 Mon Sep 17 00:00:00 2001 From: Lucas Arnaud Date: Wed, 14 Dec 2022 20:46:43 -0300 Subject: [PATCH] Fix matching stubs with HashExcludingMatcher Stubs using HashExcludingMatcher were not working because body is not being converted to a hash in order to do the matching --- lib/webmock/request_pattern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/webmock/request_pattern.rb b/lib/webmock/request_pattern.rb index 8fb84e83..7f9437d4 100644 --- a/lib/webmock/request_pattern.rb +++ b/lib/webmock/request_pattern.rb @@ -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) ||