---
title: "webmock 4.0.0 Breaking Changes on RubyGems | Since.dev"
description: "What each webmock release removed, renamed or changed: 14 breaking changes in 5 versions on RubyGems, each with its source."
canonical_url: https://since.dev/packages/gem/webmock
last_updated: 2026-12-04
---

# 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

Latest version `4.3.0`, released December 4, 2026. [Source repository](https://github.com/bblimke/webmock)

Its 4.0.0 release requires [Ruby 3.0](https://since.dev/calendar/ruby/3.0.md) or later. [Ruby end of life dates](https://since.dev/calendar/ruby.md).

- From [3.42.0](#v-3-42-0) to [4.0.0](#v-4-0-0): 9 breaking changes in 1 version.
- From [0.9.0](#v-0-9-0) to [4.0.0](#v-4-0-0): 13 breaking changes in 4 versions.

## webmock 4.0.0 breaking changes

webmock 4.0.0, released November 28, 2026: 9 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](https://github.com/bblimke/webmock/releases/tag/v4.0.0)
- **Removed**  

On JRuby, WebMock 4.0 needs JRuby 9.4 or later. [github.com](https://github.com/bblimke/webmock/releases/tag/v4.0.0)
- **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](https://github.com/bblimke/webmock/releases/tag/v4.0.0)
- **Behavior changed** `read_body`  

Call read_body with a block inside the request block, not after the request has returned. [github.com](https://github.com/bblimke/webmock/releases/tag/v4.0.0)
- **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](https://github.com/bblimke/webmock/releases/tag/v4.0.0)
- **Behavior changed** `to_raise`  

Give to_raise an exception class, an exception or a message. Use to_timeout for a timeout. [github.com](https://github.com/bblimke/webmock/releases/tag/v4.0.0)
- **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](https://github.com/bblimke/webmock/releases/tag/v4.0.0)
- **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](https://github.com/bblimke/webmock/releases/tag/v4.0.0)
- **Configuration changed**  

If your Gemfile pins crack below 0.4.6, loosen the pin. [github.com](https://github.com/bblimke/webmock/releases/tag/v4.0.0)

## webmock 3.42.0 breaking changes

webmock 3.42.0, released November 26, 2026: 1 breaking change.

- **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](https://github.com/bblimke/webmock/releases/tag/v3.42.0)

## webmock 3.0.0 breaking changes

webmock 3.0.0, released April 12, 2017: 1 breaking change.

- **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](https://github.com/bblimke/webmock/blob/v3.0.0/CHANGELOG.md)

## webmock 2.0.0 breaking changes

webmock 2.0.0, released April 25, 2016: 2 breaking changes.

- **Removed**  

Ruby versions older than 1.9.3 are no longer supported. [github.com](https://github.com/bblimke/webmock/blob/v2.0.0/CHANGELOG.md)
- **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](https://github.com/bblimke/webmock/blob/v2.0.0/CHANGELOG.md)

## webmock 0.9.0 breaking changes

webmock 0.9.0, released January 31, 2010: 1 breaking change.

- **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](https://github.com/bblimke/webmock/blob/v0.9.0/CHANGELOG.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#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.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
