return if ( $c->_locate_static_file );
}
- return $c->NEXT::prepare_action(@_);
+ return $c->NEXT::ACTUAL::prepare_action(@_);
}
# dispatch takes the file found during prepare_action and serves it
return $c->_serve_static;
}
else {
- return $c->NEXT::dispatch(@_);
+ return $c->NEXT::ACTUAL::dispatch(@_);
}
}
return $c->finalize_headers;
}
- return $c->NEXT::finalize(@_);
+ return $c->NEXT::ACTUAL::finalize(@_);
}
sub setup {
--- /dev/null
+#!perl\r
+\r
+use strict;\r
+use warnings;\r
+\r
+use FindBin;\r
+use lib "$FindBin::Bin/lib";\r
+\r
+use Test::More tests => 2;\r
+use Catalyst::Test 'TestApp';\r
+\r
+SKIP:\r
+{\r
+ if ( ! TestApp->isa('Catalyst::Plugin::SubRequest') ) {\r
+ skip "Install the SubRequest plugin for these tests", 2;\r
+ }\r
+\r
+ ok( my $res = request('http://localhost/subtest'), 'Request' );\r
+ is( $res->content, 'subtest2 ok', 'SubRequest ok' );\r
+}\r
name => 'TestApp',\r
);\r
\r
-TestApp->setup( qw/Static::Simple/ );\r
+my @plugins = qw/-Debug Static::Simple/;\r
+\r
+# load the SubRequest plugin if available\r
+eval { require Catalyst::Plugin::SubRequest; };\r
+push @plugins, 'SubRequest' unless ($@);\r
+\r
+TestApp->setup( @plugins );\r
\r
sub incpath_generator {\r
my $c = shift;\r
$c->res->output( 'default' );\r
}\r
\r
+sub subtest : Local {\r
+ my ( $self, $c ) = @_;\r
+\r
+ $c->res->output( $c->subreq('/subtest2') );\r
+}\r
+\r
+sub subtest2 : Local {\r
+ my ( $self, $c ) = @_;\r
+ \r
+ $c->res->output( 'subtest2 ok' );\r
+}\r
+\r
1;\r