I am new to minitest and still new to ruby and really tired of trying to google this question without result. I would be really grateful for help:
What is the exact
In order for your test method to run, the method name needs to start with test_
. Also, the way assert_output works is that the block will write to stdout/stderr, and the arguments will be checked if they match stdout/stderr. The easiest way to check this IMO is to pass in a regexp. So this is how I would write that test:
class TestTestClass < MiniTest::Unit::TestCase
def setup
@test = TestClass.new
end
def test_output_produces_output
assert_output(/hey/) { @test.output}
end
end