user2037696
user2037696

Reputation: 1105

RubyMine Unit tests - Test Framework quit unexpectedly

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 framework quit unexpectedly"

enter image description here

/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

Maybe the problem come from that line ?

/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 '*' ...

Mode: Test script Use pre-load server: none Ruby arguments: -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) -Itest Ruby SDK: project

But I would love to have something like this:

enter image description here

Thank you

Upvotes: 25

Views: 9066

Answers (8)

Beatrice
Beatrice

Reputation: 76

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

Upvotes: 1

yozzz
yozzz

Reputation: 1277

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

Upvotes: 0

w1t3k
w1t3k

Reputation: 228

You should be sure that your test suite is running with RAILS_ENV=test

For RubyMine you can set this up in Run > Edit Configurations.. > Choose test suite you want to run (i.e. spec: project_name) > Environment variables and there add variable mentioned above.

Upvotes: 0

Denys Husiev
Denys Husiev

Reputation: 41

I had the same issue and I fixed this by removing 'guard-minitest' from Gemfile

Upvotes: 0

Matouš Borák
Matouš Borák

Reputation: 15954

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.

Upvotes: 19

Gerson Moraes
Gerson Moraes

Reputation: 1

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.

Upvotes: 0

Rob
Rob

Reputation: 1059

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

Upvotes: 6

Lior Bar-On
Lior Bar-On

Reputation: 11520

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.

Upvotes: 13

Related Questions