X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp.pm;h=a419d10b4df296741dc1db2134ada8089c481741;hb=8223995544e9031e40cac6e1d06ffc1ac8d8a275;hp=ff23ab83268d5596840088f8e5a54f3bf53d942b;hpb=a28d35e93b7cf4de0f26f18774378bef7d99565e;p=catagits%2FCatalyst-Plugin-Static-Simple.git diff --git a/t/lib/TestApp.pm b/t/lib/TestApp.pm index ff23ab8..a419d10 100644 --- a/t/lib/TestApp.pm +++ b/t/lib/TestApp.pm @@ -9,7 +9,13 @@ TestApp->config( name => 'TestApp', ); -TestApp->setup( qw/Static::Simple/ ); +my @plugins = qw/-Debug Static::Simple/; + +# load the SubRequest plugin if available +eval { require Catalyst::Plugin::SubRequest; }; +push @plugins, 'SubRequest' unless ($@); + +TestApp->setup( @plugins ); sub incpath_generator { my $c = shift; @@ -23,4 +29,16 @@ sub default : Private { $c->res->output( 'default' ); } +sub subtest : Local { + my ( $self, $c ) = @_; + + $c->res->output( $c->subreq('/subtest2') ); +} + +sub subtest2 : Local { + my ( $self, $c ) = @_; + + $c->res->output( 'subtest2 ok' ); +} + 1;