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

Fix compatibility with Minitest 5.19+ #114

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Conversation

voxik
Copy link
Contributor

@voxik voxik commented Aug 31, 2023

The MiniTest was renamed to Minitest:

minitest/minitest@9a57c52

And the MiniTest constant is now loaded just when MT_COMPAT environment variable is set:

minitest/minitest@a2c6c18

This fixes following issue:

$ ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' /builddir/build/BUILD/test/test_helper.rb:17:in `<top (required)>': uninitialized constant MiniTest (NameError) class MiniTest::Test
      ^^^^^^^^
Did you mean?  Minitest
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /builddir/build/BUILD/image_processing-1.12.2/usr/share/gems/gems/image_processing-1.12.2/test/builder_test.rb:1:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:dir>:220:in `glob'
	from -e:1:in `<main>'

The `MiniTest` was renamed to `Minitest`:

minitest/minitest@9a57c52

And the `MiniTest` constant is now loaded just when `MT_COMPAT` environment variable is set:

minitest/minitest@a2c6c18

This fixes following issue:

~~~
$ ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
/builddir/build/BUILD/test/test_helper.rb:17:in `<top (required)>': uninitialized constant MiniTest (NameError)
class MiniTest::Test
      ^^^^^^^^
Did you mean?  Minitest
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /builddir/build/BUILD/image_processing-1.12.2/usr/share/gems/gems/image_processing-1.12.2/test/builder_test.rb:1:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:dir>:220:in `glob'
	from -e:1:in `<main>'
~~~
@voxik
Copy link
Contributor Author

voxik commented Aug 31, 2023

It does not seem the test failure would be related to this PR

@janko
Copy link
Owner

janko commented Aug 31, 2023

Thanks for the patch! Yes, the test failures are unrelated.

@janko janko merged commit 709bcf7 into janko:master Aug 31, 2023
0 of 9 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.

2 participants