From: Florian Ragwitz Date: Wed, 2 Mar 2011 13:11:39 +0000 (+0100) Subject: Run http-server.t tests on something other than the server root X-Git-Tag: 5.89003~91 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=876db346c24d0016c70a281a57e4696e81abe8fe;hp=c09cc357c51103a02a4a97cece61dc1bc53877e5 Run http-server.t tests on something other than the server root --- diff --git a/t/author/http-server.t b/t/author/http-server.t index c90cb21..3bc33a0 100644 --- a/t/author/http-server.t +++ b/t/author/http-server.t @@ -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; @@ -43,7 +44,12 @@ if ($pid) { require TestApp; my $psgi_app = TestApp->_wrapped_legacy_psgi_app(TestApp->psgi_app); - Plack::Loader->auto(port => $port)->run($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 '..';