merlyn has asked for the wisdom of the Perl Monks concerning the following question:

I wrote CGI::Protototype::Mecha to test CGI::Prototype-based programs in the same application-space as the testing application, and thus without doing an actual web hit or needing a server.

However, I now find myself in the situation where I'd like to run Mechanize against a traditional CGI.pm-based program, but still without a server so I can specify some additional debug variables and ensure Devel::Cover coverage. I suppose a solution that uses HTTP::Daemon would also work.

What's the state of the art here? I haven't paid attention having been happy with my Mecha, but certainly there's someone that's done some work here.

Thanks.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Testing CGI.pm-based programs with WWW::Mechanize without a server

Replies are listed 'Best First'.
Re: Testing CGI.pm-based programs with WWW::Mechanize without a server
by Corion (Patriarch) on Aug 04, 2006 at 12:28 UTC

    I wrote Test::HTTP::LocalServer, which can spawn a local HTTP server against which you can then run requests. That module is very specific for my needs and the spawned server is rather slim because it was more geared towards testing WWW::Mechanize(::Shell) than towards testing an external module.

    Maypole has a CLI component to run a request from the command line - maybe you can use the idea from it. The implementation seems to override the relevant parsing parts of Maypole, so your option would be to do the same but for your framework.