diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-01-06 14:38:24 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-01-06 14:38:24 -0600 |
commit | 642b11b4f8d5edacd55e6b10e0b287047acc1ae1 (patch) | |
tree | af7604e5dbd96d5bc99fbab4c2b7aa9a678029d6 /t | |
parent | 5cd0eab98e088720e6090e8533b1fb8e52a8a214 (diff) | |
download | plack-client-642b11b4f8d5edacd55e6b10e0b287047acc1ae1.tar.gz plack-client-642b11b4f8d5edacd55e6b10e0b287047acc1ae1.zip |
major refactoring, things are a lot cleaner now
Diffstat (limited to 't')
-rw-r--r-- | t/02-inputs.t | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/t/02-inputs.t b/t/02-inputs.t index 4b27630..faa5e5a 100644 --- a/t/02-inputs.t +++ b/t/02-inputs.t @@ -125,18 +125,22 @@ sub test_responses { "GET\n/\n\n" ); - my $uri = URI->new($base_uri); - $uri->scheme('http') - if $base_uri =~ /psgi-local/; - my $env = HTTP::Request->new(GET => $uri)->to_psgi; - $env->{'psgi.url_scheme'} = 'psgi-local' - if $base_uri =~ /psgi-local/; - response_is( - $client->request($env), - 200, - ['Content-Type' => 'text/plain', 'Content-Length' => '7'], - "GET\n/\n\n" - ); + { + my $base = URI->new($base_uri); + my $uri = $base->clone; + $uri->scheme('http'); + $uri->path('/') unless $uri->path; + my $env = HTTP::Request->new(GET => $uri)->to_psgi; + $env->{'plack.client.url_scheme'} = $base->scheme; + $env->{'plack.client.app_name'} = $base->authority + if $base->scheme eq 'psgi-local'; + response_is( + $client->request($env), + 200, + ['Content-Type' => 'text/plain', 'Content-Length' => '7'], + "GET\n/\n\n" + ); + } } done_testing; |