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!
Please sign in to leave a comment.
I'd check working directory and load path for the configuration you are using.
Hope this helps, Oleg.
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
Could you please provide screenshot of the configuration you are using.
Regards, Oleg.
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.
Go to menu Run|Edit Configurations... and you will see something similar to the screenshot I've attached.
Oleg.
Attachment(s):
run_configuration.png
Sure thing, my configuration is attached.
Thanks,
Ernest
It looks like you need to add "-Itest" at the beginning of "Ruby arguments".
Hope this helps, Oleg.
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?
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.