mocha breaking changes
mocha 3.0.0 (December 15, 2025) is its newest release with breaking changes, 10 of them. The first: Removes support for running tests with Minitest below v5 in mocha 3.0.0. Every breaking API change we have recorded in mocha on RubyGems: 23 breaking changes in 3 versions. Below, its 3 versions with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 3.1.0. Source repository
Its 3.0.0 release drops Ruby 2.1. Ruby end of life dates.
- From 2.0.0 to 3.0.0: 10 breaking changes in 1 version.
- From 1.0.0 to 3.0.0: 19 breaking changes in 2 versions.
mocha 3.0.0 breaking changes
- Removed
Tests can no longer run with Minitest versions older than v5. github.com - Removed
ParameterMatcher
Deprecated ParameterMatcher methods are removed; use the methods now available in ParameterMatcher::Methods. github.com - Removed
ParameterMatchers.Base
The deprecated ParameterMatchers::Base class is removed; include ParameterMatchers::BaseMethods module instead. github.com - Removed
use_test_unit_gem
Documentation for the use_test_unit_gem option is removed; the docs no longer describe it. github.com - Renamed
stubbee
The #stubbee method is renamed to #stubba_object, and #mock_owner is renamed to #stubbee. github.com - Behavior changed
Ruby 2.1 is no longer supported; users on that version must upgrade Ruby. github.com - Behavior changed
Hash.mocha_inspect
Failure messages now show hashes in Ruby v1.9 Hash syntax, which changes the displayed text. github.com - Behavior changed
Mocha.ParameterMatchers.Methods.equivalent_uri
Keyword arguments can now match an expectation that expects only positional arguments. github.com - Behavior changed
Mockery.teardown
Calling Mockery.teardown before Mockery.setup now produces an improved error message. github.com - Default changed
On Ruby 3 and later, keyword arguments are matched strictly by default; code relying on loose matching may fail. github.com
mocha 2.0.0 breaking changes
- Removed
Ruby v1.9 is no longer supported; users on Ruby 1.9 must stay on mocha 1.x. github.com - Removed
Configuration
Deprecated methods in Configuration have been removed. github.com - Removed
minitest
Minitest versions earlier than v3.3.0 are no longer supported. github.com - Removed
mocha.rails init.rb
The deprecated Rails plugin init.rb file has been removed. github.com - Removed
mocha.setup.rb
The deprecated mocha/setup.rb setup mechanism has been removed. github.com - Removed
Remove optional reinstatement of v1.9 behaviour
The option to reinstate v1.9 behaviour is gone. github.com - Removed
test-unit
Gem versions of test-unit earlier than v2.5.1 and the Ruby 1.8 standard library version are no longer supported. github.com - Behavior changed
Expectation.with
Keyword arguments can now be matched strictly, which can make previously passing hash-argument expectations fail; check Expectation#with and strict_keyword_argument_matching. github.com - Behavior changed
mock
A mock receiving invocations in another test now fails immediately. github.com
mocha 1.0.0 breaking changes
- Behavior changed
Stubbed methods now keep the visibility of the original method, so protected or private methods stay non-public. Tests relying on the stubbed method being public may break. github.com - Behavior changed
Requiring 'mocha/setup' no longer needs a separate require 'mocha'. github.com - Behavior changed
Stubbing a superclass method and calling it on a child class now uses the superclass stub instead of raising an unexpected invocation error. Existing tests relying on the old behaviour may break. github.com - Configuration changed
mocha.setup
Mocha no longer tries to integrate with test libraries automatically. Use require 'mocha/setup' once the test library is loaded, or require 'mocha/test_unit' or 'mocha/mini_test' instead. 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.