Consider the following MiniTest file:
# test_stuff.rb
require 'minitest/autorun'
class TestStuff < MiniTest::Unit::TestCase
def test_first_thing
assert_equal 4, (2 * 2)
end
def test_second_thing
assert_equal 9, (3 * 3)
end
end
If we want to run all the tests in this file, we can do so with:
$ ruby test_stuff.rb
But what if we want to run a specific test? We can target a single MiniTest
example with the --name
flag and the name of that example. We can do
something like the following:
$ ruby test_stuff.rb --name test_second_thing