From 2a165a5e173db70c9a4af58d920ce9d23e07f513 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 12 Jan 2011 21:43:14 -0600 Subject: stop using plackup, because some testers can't see binaries --- t/01-basic.t | 4 +++- t/02-inputs.t | 8 +++----- t/03-delayed-response.t | 8 +++----- t/04-streaming.t | 8 +++----- t/lib/Plack/Client/Test.pm | 5 ++++- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/t/01-basic.t b/t/01-basic.t index e152f8d..46ffd50 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -6,7 +6,9 @@ use Test::More; use Plack::Client::Test; test_tcp_plackup( - 'sub { [ 200, ["Content-Type" => "text/plain"], [shift->{PATH_INFO}] ] }', + sub { + [ 200, ["Content-Type" => "text/plain"], [shift->{PATH_INFO}] ] + }, sub { my $base_url = shift; diff --git a/t/02-inputs.t b/t/02-inputs.t index 094aec6..5f9b56a 100644 --- a/t/02-inputs.t +++ b/t/02-inputs.t @@ -7,8 +7,7 @@ use Plack::Client::Test; use HTTP::Message::PSGI; -my $app = <<'APP'; -sub { +my $app = sub { my $env = shift; return [ 200, @@ -30,8 +29,7 @@ sub { }, ] ]; -} -APP +}; test_tcp_plackup( $app, @@ -44,7 +42,7 @@ test_tcp_plackup( { my $apps = { - foo => eval $app, + foo => $app, }; my $base_uri = 'psgi-local://foo'; diff --git a/t/03-delayed-response.t b/t/03-delayed-response.t index d86116d..a034f4a 100644 --- a/t/03-delayed-response.t +++ b/t/03-delayed-response.t @@ -7,8 +7,7 @@ use Plack::Client::Test; use HTTP::Message::PSGI; -my $app = <<'APP'; -sub { +my $app = sub { my $env = shift; return sub { my $cb = shift; @@ -33,8 +32,7 @@ sub { ] ]) }; -} -APP +}; test_tcp_plackup( $app, @@ -47,7 +45,7 @@ test_tcp_plackup( { my $apps = { - foo => eval $app, + foo => $app, }; my $base_uri = 'psgi-local://foo'; diff --git a/t/04-streaming.t b/t/04-streaming.t index 6c475ff..2bee7a9 100644 --- a/t/04-streaming.t +++ b/t/04-streaming.t @@ -7,8 +7,7 @@ use Plack::Client::Test; use HTTP::Message::PSGI; -my $app = <<'APP'; -sub { +my $app = sub { my $env = shift; return sub { my $cb = shift; @@ -34,8 +33,7 @@ sub { ); $w->close; }; -} -APP +}; test_tcp_plackup( $app, @@ -48,7 +46,7 @@ test_tcp_plackup( { my $apps = { - foo => eval $app, + foo => $app, }; my $base_uri = 'psgi-local://foo'; diff --git a/t/lib/Plack/Client/Test.pm b/t/lib/Plack/Client/Test.pm index 764366f..501bf56 100644 --- a/t/lib/Plack/Client/Test.pm +++ b/t/lib/Plack/Client/Test.pm @@ -3,6 +3,7 @@ use strict; use warnings; use HTTP::Headers; +use Plack::Runner; use Plack::Util; use Test::More; use Test::TCP; @@ -92,7 +93,9 @@ sub test_tcp_plackup { }, server => sub { my $port = shift; - exec('plackup', '--port', $port, '-E', 'foo', '-e', $server); + my $runner = Plack::Runner->new(env => 'foo'); + $runner->parse_options('--port', $port); + $runner->run($server); }, ) } -- cgit v1.2.3-54-g00ecf