tweak the test case
[catagits/Catalyst-Runtime.git] / t / lib / TestMiddlewareFromConfig / testmiddlewarefromconfig.pl
CommitLineData
9da24147 1use Plack::Middleware::Static;
2
3my $static = Plack::Middleware::Static->new(
4 path => qr{^/static/}, root => TestMiddlewareFromConfig->path_to('share'));
5
6my $conf = +{
7 'Controller::Root', { namespace => '' },
8 'psgi_middleware', [
9da24147 9 $static,
10 'Static', { path => qr{^/static2/}, root => TestMiddlewareFromConfig->path_to('share') },
11 'Runtime',
12 '+TestMiddleware::Custom', { path => qr{^/static3/}, root => TestMiddlewareFromConfig->path_to('share') },
13 sub {
14 my $app = shift;
15 return sub {
16 my $env = shift;
17 if($env->{PATH_INFO} =~m/forced/) {
18 Plack::App::File->new(file=>TestMiddlewareFromConfig->path_to(qw/share static forced.txt/))
19 ->call($env);
20 } else {
21 return $app->($env);
22 }
23 },
24 },
25
26 ],
27};