RubyMine单元测试出现“Test Framework quit unexpectedly”的错误怎么办?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (56)

当我尝试从RubyMine运行测试时,我遇到了问题。但奇怪的是,当我从命令行运行测试时,它工作正常。

Test framework quit unexpectedly

/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) -Itest /Users/sabour/Desktop/EIP/project/test/controllers/categories_controller_test.rb
Testing started at 1:39 AM ...
Run options: --seed 14336

# Running tests:

/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228: warning: nested repeat operator + and ? was replaced with '*'
...

Finished tests in 2.554592s, 1.1744 tests/s, 8.6119 assertions/s.

3 tests, 22 assertions, 0 failures, 0 errors, 0 skips

Process finished with exit code 0

也许问题来自该行?

提问于
用户回答回答于

我遇到了同样的问题,这是因为没有安装测试库的ruby。例如,对于minitest测试框架,只需从命令行运行即可:

gem install minitest
gem install minitest-reporters

这解决了我的问题。

用户回答回答于

基本上你需要将你的项目minitestminitest-reportersgem包含到你的项目中,并添加一个调用来使用新格式的测试报告:

# Gemfile
group :test do
  gem 'minitest'
  gem 'minitest-reporters'
end

# test/test_helper.rb
require 'minitest/reporters'
MiniTest::Reporters.use!

扫码关注云+社区