我有一个 rails 3.2.14 项目,我正在 Windows 7 机器上开发。
我最近开始在运行时收到这些警告bundle exec rspec
:
MiniTest::Unit::TestCase is now Minitest::Test. From C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit/testcase.rb:8:in '<module:Unit>'
MiniTest::Unit::TestCase is now Minitest::Test. From C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/test_case.rb:12:in '<module:ActiveSupport>'
MiniTest::Unit::TestCase is now Minitest::Test. From C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/descendants_tracker.rb:34:in 'inherited'
MiniTest::Unit::TestCase is now Minitest::Test. From C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/descendants_tracker.rb:34:in 'inherited'
MiniTest::Unit::TestCase is now Minitest::Test. From C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/descendants_tracker.rb:34:in 'inherited'
MiniTest::Unit::TestCase is now Minitest::Test. From C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/descendants_tracker.rb:34:in 'inherited'
Run options: include {:focus=>true}
按照这个 SO 问题的答案(这个 MiniTest::Unit::TestCase 警告是什么意思?),我尝试通过将其添加到我的 gemfile 来降级到 minitest 4.0:
gem 'minitest', '~> 4'
但是,一旦我这样做了,我会在测试完成时收到这些错误:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/minitest-4.7.5/lib/minitest/unit.rb:849:in `write': closed stream (IOError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/minitest-4.7.5/lib/minitest/unit.rb:849:in `puts'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/minitest-4.7.5/lib/minitest/unit.rb:849:in `puts'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/minitest-4.7.5/lib/minitest/unit.rb:1069:in `_run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/minitest-4.7.5/lib/minitest/unit.rb:1059:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/minitest-4.7.5/lib/minitest/unit.rb:795:in `block in autorun'
考虑到这可能是 ruby 的问题,我升级到 1.9.3.p429,但那里没有乐趣,行为仍然存在。我该如何解决这些问题?