-->

What does this MiniTest::Unit::TestCase warning me

2020-07-06 02:21发布

问题:

My tests were running without problems, when suddenly the following warning appeared:

MiniTest::Unit::TestCase is now Minitest::Test

This was reported in the following libs:

ruby-1.9.3-p392/lib/ruby/1.9.1/test/unit/testcase.rb:8:in `<module:Unit>'
gems/activesupport-3.2.12/lib/active_support/test_case.rb:12:in `<module:ActiveSupport>'
gems/activesupport-3.2.12/lib/active_support/descendants_tracker.rb:34:in `inherited'

I have no idea what prompted these warnings to appear. Does anybody know what I can do to eliminate the warnings?

The test still appear to run fine, even with the warnings.

My Rails environmentis 3.2.12, running on OSX 10.8.4.

Thanks!

回答1:

You must have upgraded to minitest 5.0. MiniTest::Unit::TestCase was renamed to Minitest::Test. Here are the release notes.



回答2:

Another possibility: you're using a newer version of ruby. I was getting this warning/error running on ruby 2.1.2 (even with minitest 4.7.5); downgrading to ruby 2.0.0 resolved it



回答3:

You can use the new gem version of test-unit and minitest together. Example:

gem "test-unit", "~> 3.0"
gem "minitest", "~> 5.5"