How to activate test-unit for RubyMine when developing a library (gem)?

1.2k Views Asked by At

I'm developing a library (a gem) using Ruby 1.9.2. My Gemspec looks like the usual for a gem:

source "http://rubygems.org"

# Specify your gem's dependencies in table_builder.gemspec
gemspec

while in my gemspec I have this line:

s.add_development_dependency "test-unit"

I can see it's being installed and my Gemfile.lock includes it:

PATH
  remote: .
  specs:
    foobar (0.0.1)

GEM
  remote: http://rubygems.org/
  specs:
    test-unit (2.4.5)

PLATFORMS
  ruby

DEPENDENCIES
  foobar!
  test-unit

In my Rakefile I load it with:

require "rubygems"
require "test/unit"

as well as in my test_helper.rb:

require "rubygems"
require "test/unit"

In the command line the tests run and pass, but in RubyMine, whether I run tests or the test rake task, I get this message:

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'm using RVM, so I checked the SDK is the one I'm using on the command line and test-unit is listed in the list of installed gems.

So, how I activate test-unit in a way that RubyMine likes?

2

There are 2 best solutions below

0
Pablo Fernandez On BEST ANSWER

RubyMine 4.0 (in RC2 at the time of this writing) supports minitest and managed to run the tests out of the box. Way to go JetBrains!

2
CrazyCoder On

Please refer to help. You need Gemfile with the used gems listed in it for RubyMine to recognize the dependencies.