Michael Durrant
Michael Durrant

Reputation: 96564

rubymine only able to run model tests one by one

I am able to right-click on any of my 3 spec/models but when I right click the spec/models folder and select 'run all tests in models' I get 'Unable to attach test reporter to test framework'. The first line of my model tests is: require 'spec_helper.rb'

Upvotes: 1

Views: 537

Answers (3)

Jim Stewart
Jim Stewart

Reputation: 17323

I posted this answer for another question. It may help with this one as well:

On my system, the problem was the "redgreen" gem. It automatically colors the progress marks (dots) and the Test::Unit summary messages based on success or failure. There must be something in RubyMine that's trying to parse the Test::Unit results (the output of "rake test", I imagine), and it's choking on the ANSI sequences.

I commented out "require 'redgreen'" in my test/test_helper.rb, and the problem went away. I really like redgreen for executing "rake test" from the shell, though, so I put this in test_helper to make it work for both "rake test" and within RubyMine:

require 'redgreen' if $stdin.tty?

It may not be redgreen that's causing your problem, but be suspicious of anything which might create unconventional Test::Unit output.

Good luck!

Upvotes: 2

Michael Durrant
Michael Durrant

Reputation: 96564

The answer in the end for my setup was to fiddle around with the IDE settings including the ruby version, making sure it was 1.9.2 and the directories referenced in the config. screens were correct. This plus some restarts resolved the issue.

Upvotes: 0

jschorr
jschorr

Reputation: 3054

I had the same issue and had to add the following to /etc/launcd.conf (I had to create this file as well):

setenv DYLD_LIBRARY_PATH /usr/local/mysql/lib/

and reboot. There are other ways to do it as well (a plist file, adding this environmental variable to RubyMine, etc… but this was most reliable. Of course, this assumes that you use MySQL.

Upvotes: 0

Related Questions