Repository navigation
Update dependency webmock to v3.34.0 - #1462
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/webmock-3.x-lockfile
branch
from
October 11, 2026 01:46
3e432b0 to
e7cbf77
Compare
renovate
Bot
force-pushed
the
renovate/webmock-3.x-lockfile
branch
from
October 11, 2026 05:54
e7cbf77 to
894001d
Compare
renovate
Bot
force-pushed
the
renovate/webmock-3.x-lockfile
branch
2 times, most recently
from
October 14, 2026 02:39
4480d71 to
09ec646
Compare
renovate
Bot
force-pushed
the
renovate/webmock-3.x-lockfile
branch
from
October 14, 2026 20:45
09ec646 to
d8b3a76
Compare
renovate
Bot
force-pushed
the
renovate/webmock-3.x-lockfile
branch
from
October 15, 2026 06:09
d8b3a76 to
02526d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.26.4→3.34.0Release Notes
bblimke/webmock (webmock)
v3.34.0Compare Source
Allow
with(query: :any)to match any query string (#1099)stub_request(:get, "www.example.com").with(query: :any)matches requests with any query string, or none. RSpec'sanythingworks the same way. Previously, this raisedNoMethodError, and you had to writewith(query: hash_including({})).Use a URL without query parameters when passing
query: :any. Otherwise, WebMock raisesArgumentError.Thanks to nightpool
Raise a clear
ArgumentErrorfor an unsupportedqueryoptionPreviously, a value such as
with(query: :all)raisedNoMethodError(undefined methodsplit). The new error lists the supported values.Show
anythingfor keys given without a value tohash_includingorhash_excludingoutside RSpecPreviously, with Minitest or Test::Unit, messages showed
#<WebMock::Matchers::AnyArgMatcher:0x...>, for example forwith(query: hash_including(:a)). RSpec's own matchers already showedanything.Provide
HTTP_HOSTtoto_rackapps when the client has not supplied a Host header (#1084)Previously, requests from some HTTP clients reached the Rack app without
HTTP_HOST. This caused host checks such as Sinatra'sHostAuthorizationto see an empty host.WebMock now fills in the host from the request URL, including the port when it is not the default. An explicit Host header is preserved.
Thanks to Benoit Tigeot
Fix Rack compatibility for
to_rackappsThe request environment now passes
Rack::Lint.SERVER_PORTandCONTENT_LENGTHare now strings. If your app or tests read them directly, use string comparisons, such asenv['SERVER_PORT'] == "80". The environment also includesSERVER_PROTOCOL.CONTENT_TYPEis omitted when the request has no content type. TheContent-Lengthheader is passed only asCONTENT_LENGTH, without an extraHTTP_CONTENT_LENGTHentry.Transfer-Encodingis removed because the body has already been decoded.Repeated header values are joined into one string. Header values and the body read from
rack.inputnow use binary (ASCII-8BIT) strings.v3.33.0Compare Source
Return
effective_urlas a String for stubbed Typhoeus responses (#869)Previously, this was an
Addressable::URI. If your code calls methods such aseffective_url.host, parse the returned string into a URI first.The URL keeps the request's port, query order and encoding. It follows curl's formatting: for example,
http://example.com:80becomeshttp://example.com:80/. Stubbed timeouts now provide aneffective_urltoo.Thanks to Tom Brammar
Fix incorrect removal of default ports from displayed URLs
WebMock could accidentally remove
:80or:443from a URL's path or query. For example, an error message could show/foo/barinstead of/foo:80/bar.Only the host's default port is now removed. This also works when the port is immediately followed by a query string, as in
http://example.com:80?a=b.Set
return_codeto:okfor completed stubbed Typhoeus requests (#736)return_codeis now:okandreturn_messageis now"No error"; both were previouslynil. This includes HTTP error responses such as 404::okmeans the transfer completed. Stubbed timeouts still return:operation_timedout.Thanks to Michael Spiz
Fix the raw headers returned by stubbed Typhoeus responses
The
response_headersstring now uses the stubbed HTTP status. For example, a 404 stub no longer reportsHTTP/1.1 200 OK.Stubs without headers now return an empty
headershash ({}) instead ofnil. Theirresponse_headerscontains the status line instead of beingnil.The raw headers use binary string encoding, matching real responses. For timeouts,
response_headersis now an empty string.v3.32.0Compare Source
Make a
Net::HTTPobject created while WebMock was enabled behave like any otherNet::HTTPobject afterWebMock.disable!(#1067)Such an object, like a connection cached by net-http-persistent or by Capybara with Selenium, used to raise
ArgumentErroronstartor a stubbed request, andWebMock::NetConnectNotAllowedErroron any other request, after WebMock was disabled. It now sends real requests until WebMock is enabled again.Thanks to Mike Taylor and James Rodovich
Connect again when a request is retried on a
Net::HTTPobject that WebMock started without connecting and whose first real connection failedSuch a retry used to raise
NoMethodError(undefined methodclosed?for nil). It now tries to connect again, and raises the connection error if that fails too.Drop the
Transfer-Encodingheader from stubbed async-http responses, as WebMock already does withContent-Length(#1044)A stub with a
Transfer-Encodingheader, such aschunked, used to fail with "Message contains both transfer encoding and content length". async-http sets both headers itself from the body, and its responses from real servers don't include them either.Thanks to Tim Mertens
Record requests made with curb's
http_patchas PATCH requests with their body (#1112)curb has
http_patchsince 1.0.8. WebMock recorded such a request as a GET, or as a POST afterpost_body=, so a PATCH stub never matched it.Thanks to Andy Williams
Record a curb request sent without a body as having none, even after an earlier
http_postorhttp_patchcall with a body on the sameCurl::EasyobjectFor example, after
c.http_post("a=1"),c.resetandc.http(:POST), the second request was recorded with the bodya=1, so a stub for that body matched it.v3.31.0Compare Source
Return the contents of a
FileorPathnamebody given toto_return_json, or returned by its body lambda, instead of encoding the object as a JSON string (#1119)The file is read and closed as it is for
to_return: when the stub is declared, or on each request when it comes from a lambda.Thanks to Alex
Match HTTP methods given as a string or in upper case, as in
stub_request("get", ...),a_request("GET", ...)orassert_requested("post", ...)(#821)Before, such a method never matched, so the stub never applied and negative expectations like
assert_not_requested("get", ...)always passed. A test that passed only because of this can now fail.The method of a request is now always a lower case Symbol too. A request made with an upper case method, as Typhoeus does with
method: :POST, now matches a:poststub, and callbacks andwithblocks see:post.Thanks to Euisan Kim
v3.30.0Compare Source
Allow narrowing an RSpec expectation on a stub with
with, as inexpect(stub).to have_been_requested.once.with(body: "abc")(#1128)The expectation counts only the requests that match both the stub and the conditions given to
with. The stub itself does not change.Thanks to Sébastien S.
Show the JSON body hint for expectations narrowed with
withtoo, and no longer show it when a block is given to the stub or expectation, since checking would mean calling the blockAllow a full URL with a path in
disable_net_connect!(allow: ...), as inallow: "https://github.com/mozilla/geckodriver/releases/latest"(#977)URLs are compared the same way as in stubs, so the default port, letter case in the host, and the order and encoding of query parameters don't matter. A URL without a path or query allows every path on that scheme, host and port; a trailing slash restricts requests to
/with no query string. Credentials in either URL are ignored.Thanks to Henry Blyth
v3.29.0Compare Source
Show a body diff for JSON requests whose content type has a
+jsonsuffix, such asapplication/vnd.api+json, and for the other content types WebMock already matches as JSON (#734)Thanks to Olivier Brisse
Ignore the case of JSON, XML and url-encoded content types when matching request bodies, and match bodies of any
+jsonor+xmlmedia type, such asimage/svg+xml, as JSON or XMLSuggest declaring a JSON body as a hash when a request fails to match only because the JSON is formatted differently (#649)
A body declared as a string must match the request body exactly, including key order and whitespace. When that is the only difference, the error for an unregistered request and the failure message of a request expectation now say so, and suggest
with(body: JSON.parse(json_string)). Matching JSON strings regardless of key order by default is planned for the next major version (#485).v3.28.0Compare Source
Fix
to_rackapps receiving arack.sessionthey did not set up (#985)WebMock used to add a session hash to the Rack env, shared by every request to the same stub. This confused apps that check whether a session is present, such as Rails API-only apps, and carried session data over between requests. WebMock now leaves
rack.sessionandrack.session.optionsunset, as a real server does. If your app needs a session, include session middleware in the app you pass toto_rack.RackResponse#sessionandRackResponse#session_optionshave been removed.Thanks to Jan Graichen
Fix crash when matching a hash body pattern against a JSON or XML request that has no body
Thanks to Chris
No longer warn about curb versions newer than the last one tested
Document regexp values in
hash_includingThanks to Christian Bruckmayer
Remove unused
RequestSignatureSnippet#request_paramsThanks to Daniel Pepper
v3.27.0Compare Source
Fix crash in async-http adapter when a request header has a nil value
Thanks to hikmetba-bit
The async-http adapter now matches stubs against raw request header values instead of values parsed by protocol-http, consistent with the other adapters
Add RSpec
hash_excludingsupport to body matchingThanks to Chris Gunther
Fix
hash_excludingignoring keys given without a value and regexp values, in both query and body matchingFix crash when matching a request that has more than one
Content-TypeheaderConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.