Skip to content

Commit

Permalink
Fix Mocha/Minitest compatibility
Browse files Browse the repository at this point in the history
It turns out we were relying on the very old [1] MiniTest module name
rather than the newer Minitest module name. While there are other places
in the code that use the MiniTest form, most (all?) of those are
internal to Mocha. Anyway making this one change seems to fix the
problems people are having.

Ideally I'd like to add a failing test to force me to make this change,
but I don't have time right now and I want to fix the problem for people
as soon as possible. I've run this fix against a large test suite and
the build passes [2], so it doesn't feel very risky releasing this.

It would also be good to do a general clean up of all the uses of
MiniTest to make sure I haven't missed anything.

Fixes freerange#614.

[1]: https://github.com/minitest/minitest/blob/master/History.rdoc#505--2013-06-20-
[2]: alphagov/whitehall#8015
  • Loading branch information
floehopper authored and ywenc committed Aug 10, 2023
1 parent 0df9258 commit 8b117ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mocha/integration/mini_test/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.description

# @private
def self.included(_mod)
Mocha::ExpectationErrorFactory.exception_class = ::MiniTest::Assertion
Mocha::ExpectationErrorFactory.exception_class = ::Minitest::Assertion
end

# @private
Expand Down

0 comments on commit 8b117ad

Please sign in to comment.