Imagine I have a test like this:
class MyUnitTest < Test::Unit::TestCase
def test_first
# test code here
end
def test_second
# test code here
end
def test_third
# test code here
end
end
My test cases are destructive, and I need to regenerate the input in between tests. Therefore, it would be useful to run only one test case at a time. Currently, my approach is to comment tests that I don’t want executed, but surely there must be a better way?
So, for example, how do I run only test_first when I execute my test?
Use
--name PATTERNargument in order to filter out test names you want to run.