According to Jason Purdy <[email protected]> on Thu, 11/04/10 at 11:24:
>
> If you're testing just the main runmode, it's pretty easy:
> 
> --
> use Test::More qw/ no_plan /;
> use MyApp;
> $ENV{'CGI_APP_RETURN_ONLY'} = 1;
> my $app = MyApp->new;
> my $html = $app->run;
> --
> 
> Save that as a test script and then run it with DProf:
> 
> perl -d:DProf 01-basic.t
> 
> If you need to emulate a specific runmode or user data, add in a CGI 
> instance with the parameters:
> 
> my $cgi = CGI->new( { rm => 'other_runmode', form_field_1 => 'data' } );
> my $app = MyApp->new( QUERY => $cgi );

Easy for you!  :-)

Thanks!

BTW, I'm not familiar with the Test::* series of modules (yet).

Regards,

web...

--
William Bulley                     Email: [email protected]

72 characters width template ----------------------------------------->|

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to