Ph0en1x
Ph0en1x

Reputation: 10067

How to make Rubymine working with minitest framework

Can't configure Rubymine to work with minitest normally. All the time it throws me exceptions

Unable to attach test reporter to test framework or test framework quit unexpectedly

Also, I can't run test by one (only all test running working), because in that case context do not load and all my classes goes to be undetermined constants (NameError: uninitialized constant <MyVariableType>).

I'm currently working with RubyMine 5 via Windows 7. (Ruby 1.9.3).

If someone know how to configure it properly i'll be very appreciate for your help.

Upvotes: 4

Views: 5268

Answers (3)

seasalty
seasalty

Reputation: 91

If you are following this guide (https://www.jetbrains.com/help/ruby/2016.1/minitest.html?origin=old_help), you don't need to include minitest-reporters in your Gemfile or have this:

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

in your test_helper.rb file if you are using MiniTest 5 or newer. I was following a tutorial that was a little outdated and ran into this issue. Be sure to delete your .idea directory and restart RubyMine and you should be good to go!

Upvotes: 1

jaytho
jaytho

Reputation: 100

I just went through this with the undefined method 'format_backtrace' error, and was getting green passing when the tests were failing and crashing.

Read the notes closely, if you are running minitest > 5.0, you don't need the minitest-reporters gem.

If you include it, perhaps like I did following the instructions, then you get the errors, and errors are not reported- (in my case, anyways). So back out and remove the require minitest/reporters from your tests, and the MiniTest::Reporters.use! line and things should be good to go.

Upvotes: 0

Ph0en1x
Ph0en1x

Reputation: 10067

Ok, great! I finally solve all my problems and now my rubymine working with minitest.

The short instruction:

  1. Read this manual and do all the stuff step by step very careful

  2. If it helps then say 'Yohuu!!!' and dancing victorious jig, if it still not working correctly goes to step 3

  3. Add 'test-unit' gem to your gem file and update it with bundler.

  4. When creating test do not forget to add require 'test_helper' add the top of the file.

IMPORTANT: your test method names should start with 'test_' pattern, like test_my_supercool_method

UPD 1: If you use Ruby 2.0, you don't need to use win32Console gem on Windows platform, even if jetbrains doc say that you should.

Upvotes: 11

Related Questions