[ABE.pm] Re: web page testing

Ricardo SIGNES rjbs-perl-abe at lists.manxome.org
Wed Jul 28 10:01:08 CDT 2004


* Phil Lawrence <phil at five-lawrences.com> [2004-07-28T09:17:35]
> Ricardo SIGNES wrote:
> >* Phil Lawrence
> >
> >>Anyway, why not have:
> >>./t
> >>./t/modules
> >>./t/modules/login.pm
> >>[ ... ]
> >
> >...why not indeed? :)  That's probably what I'd do, if I had
> > a lot of repeated stuff, too.
> 
> Here's why not:  I can't use Test::More from within those modules, 
> because I already used it in the ./t/test_driver.pl script!  :-(

Ah, I didn't realize you were putting tests in there.  I figured you
meant it would give you the objects you wanted to perform tests on --
and that you'd tested that code elsewhere.

The test builder is a singleton, and can only receive one plan.  If you
try using Test::More twice, that will try to make it plan twice, which
will blow it up.

> Basically, I need the ability to write tests into each module.

Do you need tests in each module, or just code?

Also -- and I haven't tested this -- consider writing a library that you
require, rather than use, without using any package declaration.  It
will be in the main package, with the test subs available to it, and
will not need to use any test modules on its own.

-- 
rjbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/abe-pm/attachments/20040728/24d6870e/attachment.bin


More information about the ABE-pm mailing list