chopper draw lion4
chopper draw lion4

Reputation: 13487

Ruby: Tests not running

I am attempting to run the following test:

require 'minitest/spec'
require 'minitest/autorun'

def test_true_is_true
  assert "3".is_a_number?
end

When I run this file I receive the following output:

Finished in 0.001183s, 0.0000 runs/s, 0.0000 assertions/s.

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

How come none of my test are being ran?

Upvotes: 2

Views: 55

Answers (1)

joelparkerhenderson
joelparkerhenderson

Reputation: 35443

You need to use a class that inherits from MiniTest::Test like this:

require "minitest/autorun"

class TestMe < Minitest::Test
  def test_true_is_true
    assert "3".is_a_number?
  end
end

Upvotes: 3

Related Questions