Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: First stab at addressing #614 #615

Merged
merged 1 commit into from
Jul 27, 2023
Merged

Conversation

floehopper
Copy link
Member

TODO:

  • Ideally I'd like to add a failing test to force me to make this change
  • Check that other occurrences of MiniTest aren't breaking things

@Maimer
Copy link

Maimer commented Jul 26, 2023

minitest/unit is no longer being required by minitest based on this commit: minitest/minitest@a2c6c18

However, in the test_helper it is being required here: https://github.com/freerange/mocha/blob/main/test/test_helper.rb#L20

If you remove that line from the test_helper (which I believe is the correct thing to do) then you will see the failure due to the issue you are fixing in this PR.

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 #614.

[1]: https://github.com/minitest/minitest/blob/master/History.rdoc#505--2013-06-20-
[2]: alphagov/whitehall#8015
@floehopper floehopper merged commit 32ef48f into main Jul 27, 2023
16 checks passed
@floehopper floehopper deleted the fix-minitest-compatibility branch July 27, 2023 10:45
@floehopper
Copy link
Member Author

@Maimer Ah, thank you - I haven't had much time to look at this closely, so that's really helpful! 🙏

floehopper added a commit that referenced this pull request Nov 12, 2023
As per this comment [1]. Thanks, @Maimer!

As of Minitest v5.19.0 [2], there's no need to require this file.

Also the Minitest version constant is now also available at the
top-level, i.e. Minitest::VERSION, which seems like a more sensible
place to get it from.

[1]: #615 (comment)
[2]: https://github.com/minitest/minitest/blob/f908dda892e70b0389c61c12137a18be8e3fb179/History.rdoc#label-5.19.0+-2F+2023-07-26
floehopper added a commit that referenced this pull request Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants