Test::Unit fails w/no tests [was: testunit 0.1.6 problems]

Hi Nathanial,

From: nathaniel@NOSPAMtalbott.ws [mailto:nathaniel@NOSPAMtalbott.ws]
Why is it misleading?

I initially thought this meant I had done something wrong in setup and
teardown. Probably a dumb assumption, but hey, this is me we’re talking
about.

The one thing about it that I think IS misleading is that, if
you bundle up an empty TestCase with a non-empty TestCase and
run them together, you won’t get a failure anymore - the
check is only made at the runner level. I need to at the very
least make that consistent.

I’ll agree with that.

and two, it’s inconvenient. I haven’t done
it myself, but I would do this: decide my tests for a certain
class are no longer valid, delete them, but leave the shell
(the TestCase) there so I can create some new ones in the future.

I both agree and disagree with the inconvenience of it. Yes,
if you keep around a lot of unused TestCases, it would be
somewhat inconvenient, but I’m not sure that’s a practice
that ought to be supported. As an XP’er, I’d say, “YAGNI!”
and delete the TestCase as soon as it’s empty, knowing that
it’s cinchy to add back. If I know that I’m going to add
another test to that TestCase in a minute, then the failure
is a boon, because it keeps me from getting distracted and
forgetting to add the test.

I like to start with an empty test case to make sure the “require” for
whatever module I’m working on works, usually because I need to mess around
with “$:”, as well make sure the constructor doesn’t bomb (assuming I have
one in setup). Maybe that’s not good XP, but that’s how I do it.

I suggest emitting a warning in hte event of an empty
TestCase.

Warnings in tests are too mushy for me; I want red or green,
true or false. I’m much more inclined to drop the failure
altogether than to add the concept of warnings to the framework.

I could live with a warning, but understand your POV.

I’m leaning towards leaving the failure, but making it more
consistent as noted above. My mind isn’t really made up yet,
though, so I’d like to hear some more on this first (if there
are any other opinions). I’m also going to try to dig up the
original request for this feature to present “the other
side”, as it were.

Thanks for listenin’

I can live with it either way, whatever you decide. I just prefer not to
have the error. :slight_smile:

Just my .02

Regards,

Dan

···

-----Original Message-----