On Fri, Jun 25, 2004 at 04:51:29PM +0100, Fergal Daly ([EMAIL PROTECTED]) wrote:
> > * I never have to type repetitive tests like
> > 
> >     isa_ok Foo->new(), 'Foo'
> > 
> > again because it's handled by a base class that all my test classes 
> > inherit from.

Repetition is good.  I feel very strongly that you should be checking
your constructor results in every single test, and checked against
literals, not variables.

my $foo = My::Foo->new();
isa_ok( $foo, 'My::Foo' );
# and then use it.
#
# Later on...
my $foo = My::Foo->new( bar => 14, bat => \$wango );
isa_ok( $foo, 'My::Foo' );

The more checks you have, the better.  Sure, the first isa_ok
technically "covers" the constructor, but why not check after EVERY
constructor?  The 2nd example is really an entirely different test.

Tests are all about quantity.


xoa

-- 
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance

Reply via email to