On Thu, Jun 24, 2004 at 02:59:30PM -0400, Andrew Pimlott wrote:
> I see this more as a limitation than a feature.  It seems to mean that
> - You need to use the same setup/teardown for all your tests.

Those that need different things aren't testing the same thing and
should move to a different class.

> - You're restricted to one test == one method, so you can't paramatrize
>   your tests by data (eg, second example below).

I'm not sure what you mean here. You can have lots of tests in a single
method. And subclasses can add their own extra tests to the parent's
tests.

> - You don't have much control (correct me if I'm wrong) about the order
>   of tests, or the relationship between tests, eg you can't say "if this
>   test fails, skip these others".  This is straightforward in
>   Test::More's simple procedural style.

You can group dependant tests into one method and have the method return
or die at any point...

> Every time I hear about xUnit, I figure there must be something other
> than "setup and teardown" in its favor.  If that's all there is, I'm not
> sold.

The big gain for me with Test::Class is inheritable tests. Subclasses
can ensure they still pass all their parent's tests, as well as all of
their own, without me having to copy all the tests, or set up a really
clumsy testing environment. And of course you get to refactor the test
suite quite nicely too so that it's really obvious what each test is
doing.

If I'm not testing something with a lot of inheritance, then Test::Class
loses about 90% of its attraction.

Tony

Reply via email to