RM 5.4 + Rails4 + minitest = cannot load such file -- test_helper

I'ma having a problem setting up testing via RubyMine. Running my test suite works fine via "rake test", but all my tests fail with "Exception message: cannot load such file -- test_helper" when I try to run them from RubyMine.

I've got the "minitest/reporters" gem in my bundle, and have places the following in test_helper.rb:


require 'minitest/reporters'
MiniTest::Reporters.use!



It seems to have trouble finding my test_helper.rb file, though. Any ideas?

I simply do a "require 'test_helper'" at the top of each of my test files.


Thanks!
9 comments
Comment actions Permalink

It looks like you need to add "-Itest" at the beginning of "Ruby arguments".

Hope this helps, Oleg.

1
Comment actions Permalink

I'd check working directory and load path for the configuration you are using.

Hope this helps, Oleg.

0
Comment actions Permalink

Hmm, can you be more specific? I just checked my load path settings in RM, and they were empty. I tried adding my "test" dir to the load path (which contains test_helper.rb), but it did not help.

Thanks,
Ernest

0
Comment actions Permalink

Could you please provide screenshot of the configuration you are using.

Regards, Oleg.

0
Comment actions Permalink

What specifically would you like me to take screenshots of? Sorry, I'm new to RubyMine! As far as I know, I haven't changed much in my config.

0
Comment actions Permalink

Go to menu Run|Edit Configurations... and you will see something similar to the screenshot I've attached.

Oleg.



Attachment(s):
run_configuration.png
0
Comment actions Permalink

Sure thing, my configuration is attached.

Thanks,
Ernest

Screen Shot 2013-06-24 at 2.20.32 PM.png

0
Comment actions Permalink

Thanks, that did the trick! Strange that that wasn't the default.

One other thing. When I run my tests, in my output I also see the test support classes (ActionController::TestCase, etc.) being tested (although these have no tests... see screenshot). Any way to get rid of this clutter?

Screen Shot 2013-06-25 at 9.58.44 AM.png

0
Comment actions Permalink

There is no such functionality (minitest runs them, report them, and thus we show them).  But you can filter out all passed test (leftmost button in the toolbar of the tool window)

Regards, Oleg.

0

Please sign in to leave a comment.