Skip to content

Conversation

@jeremyevans
Copy link
Collaborator

Ruby 4.0.0-preview3 reverted the change to have source_location return the end line. It's possible the revert will be reverted before the final Ruby 4.0.0 release, but this allows for easily switching back.

This adds support for minitest 6 and drops support for minitest 4. minitest 5 was released over 12 years, there's really no need to support minitest 4 any more.

This adds support for running individual tests (of m itself) using ruby test/some_test.rb.

With minitest 4 dropped, there is no reason to have separate gemfiles. This switches to a single gemfile that loads both test/unit and minitest.

This also fixes m usage in any environment where ruby is not the current Ruby program. This uses RbConfig.ruby to get the current Ruby program.

See individual commits for more details.

This was reverted in Ruby 4.0, with only about a week until the
release. While only the require_relative line actually needed a
change, since the code itself would be correct even with the
revert, I think it's best to use simpler code.

It's likely Ruby 4.1 will include support for this, so comment out
the code to make it easy to change back.
Do not assume it is installed as `ruby`. Use `-S rake` to
execute rake with the current Ruby version.
This file was removed in minitest 6, and there is no point in
requiring it if it isn't used.
No lib changes are needed.
The same tests work for both minitest 5 and minitest 6.

I'd like to rename test/examples/minitest_5_example_test.rb to
test/examples/minitest_example_test.rb, but since that file already
exists, I chose the ugly test/examples/minitest_5_or_6_example_test.rb
This uses require_relative to load test_helper, instead of requiring
the test directory to be in the Ruby load path.

This has test_helper use require_relative to load m, instead of
requiring the lib directory to be in the Ruby load path.
Minitest gives better progress output by default, with `.` for each
test, instead of using a spinner that does not provide information
on progress.
This avoids the need for load path modification.
When testing, it's best to have all testing libraries installed.
This doesn't work for minitest 4, but that is over 12 years old at
this point, and we can safely drop support for it.

This also removes the tests tasks from the Rakefile.
minitest 6 was just released, and minitest 5 was released over 12
years ago. It's unlikely there are any minitest 4 users that need
updated versions of m.

Remove BUNDLE_GEMFILE usage in test_bench.rb while here.
@jeremyevans jeremyevans merged commit 89243ee into qrush:master Dec 19, 2025
11 checks passed
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.

1 participant