I have not seen it mentioned here and I have just recently find out about
Test::WWW::Mechanize::CGI which is a subclass of Tes::WWW::Mechanize.
With this module one can directly test CGI::Applications without a web server.
Using this module makes it also easy to run coverage on the tests with
Devel::Cover
and see what parts of the code have you missed in the tests.
An example would be:
use Test::More tests => 1;
use Test::WWW::Mechanize::CGI;
my $w = Test::WWW::Mechanize::CGI->new;
$w->cgi(sub {
require WebApp;
my $webapp = Web->new();
$webapp->run();
});
$w->get_ok("http://some.random.name");
and from that point you can use everything available in
Test::WWW::Mechanizes.
I think this should mentioned in the documentation of CGI::Applications.
Gabor
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]