From: Tim Bates Date: 2003-01-09T20:21:30+09:00 Subject: Re: Test::Unit fails w/no tests [was: testunit 0.1.6 problems] On Thu, 9 Jan 2003 09:35 pm, NAKAMURA, Hiroshi wrote: > > I like the failure when you have an empty TestCase for the XP YAGNI > > reason you stated above. > > +1 to failure, to keep health of test. > Empty testcase is exactly a bug of the testcase. Not necessarily. And not everyone practises XP as such. (I don't like major parts of it, and other parts are just good sense). As a counterargument, I would like to put forth the following pieces of code: === # Would fail if empty, so I add something arbitrary to prevent this. class TC_EmptySample def test_nothing 'foo' end end # Will fail, just like I want. class TC_ImplementLater end === IMHO, this is a lot uglier than the alternative: === # Won't fail, just like I want. class TC_EmptySample end # Want it to fail, to remind me to implement. class TC_ImplementLater def test flunk("Not implemented!") end end === The second example makes it quite clear what fails, and why. On a related note, I can't get this failure to happen - must be exclusive to 0.1.6 (I have 0.1.4) but I can't find the start of this thread. Can someone please tell me if you get this failure when subclassing a test case with an empty class? For example: class TC_Super < Test::Unit::TestCase def testme assert_equal(2, 1+1, "Basic axioms of mathematics are wrong!") end end class TC_Sub < TC_Super end Does TC_Sub have this failure? If so, it will break my tests which is another argument against it... Tim Bates -- tim@bates.id.au