Skip to content

Commit

Permalink
Fix compatibility with Minitest 5.19+ (#114)
Browse files Browse the repository at this point in the history
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>'
~~~
  • Loading branch information
voxik authored Aug 31, 2023
1 parent 4e35a48 commit 709bcf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
require "vips"
require "mini_magick"

class MiniTest::Test
class Minitest::Test
def fixture_image(name)
File.open("test/fixtures/#{name}", "rb")
end
Expand Down

0 comments on commit 709bcf7

Please sign in to comment.