Fix META.yml author, add x_authority
[catagits/Catalyst-Runtime.git] / t / author / http-server.t
index c90cb21..0edba01 100644 (file)
@@ -7,6 +7,7 @@ use File::Path;
 use FindBin;
 use Test::TCP;
 use Try::Tiny;
+use Plack::Builder;
 
 use Catalyst::Devel 1.0;
 use File::Copy::Recursive;
@@ -42,8 +43,13 @@ if ($pid) {
     unshift @INC, "$tmpdir/TestApp/lib", "$FindBin::Bin/../../lib";
     require TestApp;
 
-    my $psgi_app = TestApp->_wrapped_legacy_psgi_app(TestApp->psgi_app);
-    Plack::Loader->auto(port => $port)->run($psgi_app);
+    my $psgi_app = TestApp->apply_default_middlewares(TestApp->psgi_app);
+    Plack::Loader->auto(port => $port)->run(builder {
+        mount '/test_prefix' => $psgi_app;
+        mount '/' => sub {
+            return [501, ['Content-Type' => 'text/plain'], ['broken tests']];
+        };
+    });
 
     exit 0;
 } else {
@@ -51,7 +57,7 @@ if ($pid) {
 }
 
 # run the testsuite against the HTTP server
-$ENV{CATALYST_SERVER} = "http://localhost:$port";
+$ENV{CATALYST_SERVER} = "http://localhost:$port/test_prefix";
 
 chdir '..';