Ruby unit test does not work

Asked

Viewed 26 times

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 give a flaw.

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 written: "Test framework quit unexpectedly".

Someone’s been through it and what could be the problem?

1 answer

1

This is not a Minitest mistake, but a Rubymine mistake.

You need to setup the Minitest for the IDE you are using. Here is the official tutorial from Jetbrains how to setup it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.