If you write a test class like
class MyTest < Test::Unit::TestCase
def setup
end
def test_1
flunk
end
def test_1
assert true
end
end
the first test_1 is ignored. Although it looks like a stupid mistake, it can happen with copy and paste programming. Apart from running
grep test test_me.rb | wc
and comparing that with how many tests test unit says has run, or using rcov or heckle, or running with -w, how can you detect such issues?
Also, is there any way of specifying that test methods shouldn't be overwritten?
Edit: The method being tested had a parameter with 6 or so possible values, and the tester wanted to test each scenario. This was why copy and paste programming was used. The only alternative I can envisage for such a scenario is a a six-element array of parameters and expected values.