RubyMine Unit tests - Test Framework quit unexpectedly

后端 未结 8 741
感动是毒
感动是毒 2020-12-30 01:00

When I try to run the tests from within RubyMine I have an issue. But what is strange is that it work fine when I run the tests from the command line.

\"Test

相关标签:
8条回答
  • 2020-12-30 01:27

    There is a nice tutorial for setting up RubyMine tests in their online help, which helped me resolve the same problem as you describe (for Test::Unit-style tests). Basically you need to include the minitest and minitest-reporters gems into your project and add a call to use the new format of tests reporting:

    # Gemfile
    group :test do
      gem 'minitest'
      gem 'minitest-reporters'
    end
    
    # test/test_helper.rb
    require 'minitest/reporters'
    MiniTest::Reporters.use!
    

    Take a look at the tutorial for more options.

    0 讨论(0)
  • 2020-12-30 01:29

    You can get this error when some of the gems are not checked out, so you will need to run bundle install. Run your test from terminal and you will get an error if that is your case

    0 讨论(0)
  • 2020-12-30 01:32

    I had the same problem, and it was caused by not installing (globally?) the ruby gems of the testing library. For instance, for the minitest testing framework (you didn't specify which one you use), just run from command line:

    gem install minitest
    gem install minitest-reporters
    

    This solved the problem to me.

    0 讨论(0)
  • 2020-12-30 01:32

    I had the same problem when running from RubyMine (but not from command line). It was fixed by restarting spring:

    bin/spring stop
    bin/spring status
    
    0 讨论(0)
  • 2020-12-30 01:36

    You can also get this error if you have two tests with the same name.

    0 讨论(0)
  • 2020-12-30 01:41

    You can fix it specifying the PATH for RSpec. To find the right path in Ubuntu, I used the command

    whereis rpsec

    In RubyMine, go to menu "Run" > "Edit Configurations", mark "Use custom RSpec runner script", and set the path found previously.

    0 讨论(0)
提交回复
热议问题