webmock breaking changes
webmock 4.0.0 (November 28, 2026) is its newest release with breaking changes, 9 of them. The first: webmock 4.0.0 requires Ruby 3.0 or later. Every breaking API change we have recorded in webmock on RubyGems: 14 breaking changes in 5 versions. Below, its 5 versions with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 4.3.0, released December 4, 2026. Source repository
Its 4.0.0 release requires Ruby 3.0 or later. Ruby end of life dates.
- From 3.42.0 to 4.0.0: 9 breaking changes in 1 version.
- From 0.9.0 to 4.0.0: 13 breaking changes in 4 versions.
webmock 4.0.0 breaking changes
- Removed
WebMock 4.0 needs Ruby 3.0 or later. On Ruby 2.6 and 2.7, Bundler keeps installing WebMock 3.x. github.com - Removed
On JRuby, WebMock 4.0 needs JRuby 9.4 or later. github.com - Behavior changed
and_return
The same ArgumentError checks as to_return and to_raise now apply to and_return, and_return_json and and_raise. github.com - Behavior changed
read_body
Call read_body with a block inside the request block, not after the request has returned. github.com - Behavior changed
request
With real requests allowed, the block given to request gets the response while Net::HTTP reads it, not after WebMock has read the whole body. Code that relied on the full body first can fail. github.com - Behavior changed
to_raise
Give to_raise an exception class, an exception or a message. Use to_timeout for a timeout. github.com - Behavior changed
to_return
Give to_return either a response such as to_return(status: 200), or a block. Bare calls now fail at declaration. github.com - Behavior changed
with
A body pattern given as a hash, array, hash_including or hash_excluding no longer matches a request body that is not valid JSON. Send the body with to_json. github.com - Configuration changed
If your Gemfile pins crack below 0.4.6, loosen the pin. github.com
webmock 3.42.0 breaking changes
- Behavior changed
after_request
For real requests made with HTTP.use(:auto_inflate), after_request callbacks now receive the inflated body without the Content-Encoding header, and Content-Length gives the inflated size. Code that reads those headers in callbacks must... github.com
webmock 3.0.0 breaking changes
- Removed
WebMock 3.0.0 no longer supports Ruby 1.9.3, so code running on that Ruby version must upgrade Ruby before using this release. github.com
webmock 2.0.0 breaking changes
- Removed
Ruby versions older than 1.9.3 are no longer supported. github.com - Behavior changed
stub_request
Credentials in the URL userinfo and in the Authorization header are now treated as separate attributes. Stub basic auth with the basic_auth option or an Authorization header instead. github.com
webmock 0.9.0 breaking changes
- Behavior changed
HTTP clients' default request headers, such as Net::HTTP's 'Accept' => '*/*', are now kept on requests instead of being suppressed. Code that asserts on the exact set of request headers may need updating. github.com
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.