Unit test in Ruby does not work

1

I am running a simple unit test and on my machine it does not show whether the test ran successfully or error. My code below should fail.

require 'minitest/autorun'

class MagicBallTest < Minitest::Test
  def test_ask_returns_an_answer
    magic_ball = MagicBall.new
    assert magic_ball.ask("hatever") != nil
  end
end

class MagicBall
  def ask question
    "Whatever"
  end
end

And the console shows the following:

Testing started at 12:41 ...
/usr/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/rafael/RubymineProjects/Miojo/app/tests/magic_ball_test.rb --name=test_ask_returns_an_answer
Run options: --name=test_ask_returns_an_answer --seed 45592

# Running:

.

Finished in 0.001261s, 793.3001 runs/s, 793.3001 assertions/s.

1 runs, 1 assertions, 0 failures, 0 errors, 0 skips

Process finished with exit code 0

There is a message on the side of the writing side: "Test framework quit unexpectedly".

Has anyone experienced this and what could be the problem?

    
asked by anonymous 27.05.2018 / 17:53

1 answer

1

This is not a Minitest bug, but a RubyMine bug.

You need to setup Minitest for the IDE you are using. Here's the official JetBrains tutorial on how to setup it.

    
29.05.2018 / 05:17