summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-01-12 21:43:14 -0600
committerJesse Luehrs <doy@tozt.net>2011-01-12 21:43:14 -0600
commit2a165a5e173db70c9a4af58d920ce9d23e07f513 (patch)
tree6095b1a4cedd4f96566edf196f20e042556b55a7
parent9970a68dbb108d36b16595d26b827a7d63223155 (diff)
downloadplack-client-2a165a5e173db70c9a4af58d920ce9d23e07f513.tar.gz
plack-client-2a165a5e173db70c9a4af58d920ce9d23e07f513.zip
stop using plackup, because some testers can't see binaries
-rw-r--r--t/01-basic.t4
-rw-r--r--t/02-inputs.t8
-rw-r--r--t/03-delayed-response.t8
-rw-r--r--t/04-streaming.t8
-rw-r--r--t/lib/Plack/Client/Test.pm5
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);
},
)
}