On Tue, Mar 29, 2011 at 10:46:20PM +0200, Michael Ludwig wrote: ... > my $tkn = $hu->token; # (1) Can't carry on without the token > like $tkn, qr/abc/; # (2) Useless carrying on if this fails.
One thing I've done is defer the plan until I can ensure the basic prerequesites for the test is met. For example, a DBD::Pg test has: === ... use Test::More ... my $dbh = connect_database(); if (! $dbh) { plan skip_all => 'Connection to database failed, cannot continue testing'; } my $pglibversion = $dbh->{pg_lib_version}; if ($pglibversion < 80000) { cleanup_database($dbh,'test'); $dbh->disconnect; plan skip_all => 'Cannot run asynchronous queries with pre-8.0 libraries.'; } plan tests => 67; === -- Greg Sabino Mullane g...@endpoint.com End Point Corporation PGP Key: 0x14964AC8
pgpQHFicV5CPJ.pgp
Description: PGP signature