What does this MiniTest::Unit::TestCase warning mean?

耗尽温柔 提交于 2019-12-05 15:43:09

问题


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"


来源:https://stackoverflow.com/questions/17461245/what-does-this-minitestunittestcase-warning-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!