first draft psgi middleware support complete
[catagits/Catalyst-Runtime.git] / t / lib / TestMiddleware.pm
index 244b957..326f1be 100644 (file)
@@ -1,5 +1,6 @@
 package TestMiddleware;
 
+use Moose;
 use Plack::Middleware::Static;
 use Plack::App::File;
 use Catalyst;
@@ -7,20 +8,22 @@ use Catalyst;
 extends 'Catalyst';
 
 my $static = Plack::Middleware::Static->new(
-  path => qr{^/static/}, root => TestApp->path_to('share'));
+  path => qr{^/static/}, root => TestMiddleware->path_to('share'));
 
 __PACKAGE__->config(
   'Controller::Root', { namespace => '' },
   'psgi_middleware', [
+    'Head',
     $static,
-    'Static', { path => qr{^/static2/}, root => TestApp->path_to('share') },
-    '+TestApp::Custom', { path => qr{^/static3/}, root => TestApp->path_to('share') },
+    'Static', { path => qr{^/static2/}, root => TestMiddleware->path_to('share') },
+    'Runtime',
+    '+TestMiddleware::Custom', { path => qr{^/static3/}, root => TestMiddleware->path_to('share') },
     sub {
       my $app = shift;
       return sub {
         my $env = shift;
         if($env->{PATH_INFO} =~m/forced/) {
-          Plack::App::File->new(file=>TestApp->path_to(qw/share static forced.txt/))
+          Plack::App::File->new(file=>TestMiddleware->path_to(qw/share static forced.txt/))
             ->call($env);
         } else {
           return $app->($env);