Search code examples
ruby-on-railstestingmodelrspecrubymine

rubyMine 'Unable to attach test reporter to test framework'


rubyMine 'MiniTest framework was detected' error when running all model tests.

I can run all model tests at the regular command line. e.g. rake spec:models
When I use rubyMine:
I can run one model test ok.
However when I try to run all tests in model I get
MiniTest framework was detected. It is a limited version of original Test::Unit framework. RubyMine/IDEA Ruby plugin test runner requires full-featured version of the framework, otherwise default console tests reporter will be used instead. Please install 'test-unit' gem and activate it on runtime.

I tried adding the 'test-unit' to my Gemfile and rebundling but now get:

`/home/durrantm/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) 
  /home/durrantm/Downloads/RubyMine-3.2.3/rb/testing/runner/tunit_in_folder_runner.rb
Testing started at 9:33 AM ...
Work directory: /home/durrantm/Dropbox_not_syncd/webs/3/rubyists/spec/models}
Loading files.... 
=========================================
0 files were loaded.
=========================================
Searching test suites...
=========================================
0 test suites, 0 tests, 0 assertions, 0 failures, 0 errors
Process finished with exit code 0`

Note: funny } in work directory. I still get the Unable to attach test_reporter to test fraemwork message.

Versions: Ubuntu 11 RubyMine 3.2


Solution

  • I finally got this to work. Mostly by changing stuff under Menus:
    Run -> Edit configurations -> Click on Rspec -> Create a new Configuration.

    For the new configuration made sure specs folder points to the application specs models.

    Final step (the one that actually that got it working) was to set the working directory (still on the run/debug configuration screen that is) to be my applications root!

    The other thing I had also done was to add gem 'test-unit' to the Gemfile and bundled it of course. However later testing (removing it and unbundling) showed it not to be needed and in fact was making tests run multiple times with empty suites (maybe trying default unit::test as well as running rspec).