On 2005-10-18, Jason Purdy <[EMAIL PROTECTED]> wrote:
>
> 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?

Michael Graham and I were discussing the same idea a few days ago.
cookies seemed like they might be a hurdle. Form submissions and file
uploads would need to be delt with, but I think they are manageable.

> 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' );
> # this would translate to the default runmode 
> $mech->get( 'http://localhost/' );

If it just does the default thing, why not: 

 $mech->get();

And as long as their isn't really a host involved, let's use the
shortest possible URL:

> $mech->get( 'http://localhost?rm=other_runmode' );

Could be: 
 $mech->get( '?rm=other_runmode' );

You have the rule strings that start with '?' talk directly to CGI::Apps,
while other calls still use real HTTP. 

The map idea suggested before could catch some http calls and convert
them back to direct CGI::App access. 

> 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).

My interest in such a framework is:

1. Easier desktop testing without Apache.
2. Faster performance, because overhead of the roundtrip with the web
   server is saved. 

I would prefer the name "Test::CGI::Application" for this, as the use of
the Mech interface could be considered an "implementation detail". 

In summary: Go, Jason, Go!

    Mark

-- 
http://mark.stosberg.com/ 


---------------------------------------------------------------------
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]

Reply via email to