I'm lining up my next cgiapp project, based on my current frustration/itch: a test module.

I've been all over the board with testing and I've identified four major methods:

1) Interface directly w/ the cgiapp
2) Write a www-mech script to interface w/ public web server
3) Ditto as #2, but interface with HTTP::Server::Simple::CGI
4) Ditto as #2, but interface with Apache::Test

There are advantages and disadvantages to each, but here's what's important to me:

A) Convenience of www-mech
B) Coverage reporting
C) Debugging

So #1 is great for B & C, but not A. #'s 2-4 are great for A, but not B & C. After some thought, I think I have the solution and am posing it here:

How about a module that offers the easy-to-use www-mech interface, but underneath the layers, it will NOT use a web server, but instead, translate the request to a CGI/query object and interface directly w/ the cgiapp?

The Catalyst project offers something like this, through a subclass of Test::WWW::Mechanize.

A test script could look something like this:

use Test::WWW::Mechanize::CGIApp;
use Test::More qw( no_plan ); # not yet

my $mech = Test::WWW::Mechanize::CGIApp->new();
$mech->set_cgiapp( 'My::CGIApp' );
$mech->get( 'http://localhost/' );
# this would translate to the default runmode -- could also use
$mech->get( 'http://localhost?rm=other_runmode' );

Anyway, just wanted to throw this out there and see if there was any interest. I have a rough skeleton going, but would love to get some expert help (the Catalyst project does this with some complex globbing, it looks like, which is a little over my head).

Cheers,

Jason

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to