From 2f2b934f3146e4f362c2d1f96c137cda01681e7b Mon Sep 17 00:00:00 2001 From: Rodrigo Argumedo <7613139+rodrigoargumedo@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:40:36 -0500 Subject: [PATCH 1/2] Use Patron::Session instead of Patron namespace --- lib/webmock/http_lib_adapters/patron_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/webmock/http_lib_adapters/patron_adapter.rb b/lib/webmock/http_lib_adapters/patron_adapter.rb index e5e227fb..2c97f91a 100644 --- a/lib/webmock/http_lib_adapters/patron_adapter.rb +++ b/lib/webmock/http_lib_adapters/patron_adapter.rb @@ -6,7 +6,7 @@ # patron not found end -if defined?(::Patron) +if defined?(::Patron::Session) module WebMock module HttpLibAdapters class PatronAdapter < ::WebMock::HttpLibAdapter From bcf38968fe3885cc21db1c9f97ab3402733ef641 Mon Sep 17 00:00:00 2001 From: Rodrigo Argumedo <7613139+rodrigoargumedo@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:29:35 +0000 Subject: [PATCH 2/2] Fix test --- spec/unit/request_pattern_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/request_pattern_spec.rb b/spec/unit/request_pattern_spec.rb index f6fb2e51..b7e85f74 100644 --- a/spec/unit/request_pattern_spec.rb +++ b/spec/unit/request_pattern_spec.rb @@ -614,7 +614,7 @@ def match(request_signature) it "should not match when body is not xml" do expect(WebMock::RequestPattern.new(:post, 'www.example.com', body: body_hash)). not_to match(WebMock::RequestSignature.new(:post, "www.example.com", - headers: {content_type: content_type}, body: "foo bar")) + headers: {content_type: content_type}, body: "")) end it "matches when the content type include a charset" do