X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F05env.t;fp=t%2F05env.t;h=c5c5351c435a512cc35b78d9c3b4863cf5b010a8;hb=090cc06098fe44e972670fa00b2c57ad80b71359;hp=51cd0b8b83d562e835d2483a2bbfff5ae763a53d;hpb=878085c87f3f78e4bfc4dce3762daf7a33c2b20e;p=catagits%2FHTTP-Request-AsCGI.git diff --git a/t/05env.t b/t/05env.t index 51cd0b8..c5c5351 100644 --- a/t/05env.t +++ b/t/05env.t @@ -1,6 +1,6 @@ #!perl -use Test::More tests => 8; +use Test::More tests => 9; use strict; use warnings; @@ -9,15 +9,16 @@ use IO::File; use HTTP::Request; use HTTP::Request::AsCGI; -my $r = HTTP::Request->new( GET => 'http://www.host.com/cgi-bin/script.cgi?a=1&b=2' ); +my $r = HTTP::Request->new( GET => 'http://www.host.com/my/path/?a=1&b=2' ); my $c = HTTP::Request::AsCGI->new($r); -$c->stdout( IO::File->new_from_fd( STDOUT->fileno, '>' ) ); -$c->stderr( IO::File->new_from_fd( STDERR->fileno, '>' ) ); +$c->stdout(undef); +$c->stderr(undef); $c->setup; is( $ENV{GATEWAY_INTERFACE}, 'CGI/1.1', 'GATEWAY_INTERFACE' ); is( $ENV{HTTP_HOST}, 'www.host.com:80', 'HTTP_HOST' ); +is( $ENV{PATH_INFO}, '/my/path/', 'PATH_INFO' ); is( $ENV{QUERY_STRING}, 'a=1&b=2', 'QUERY_STRING' ); is( $ENV{SCRIPT_NAME}, '/', 'SCRIPT_NAME' ); is( $ENV{REQUEST_METHOD}, 'GET', 'REQUEST_METHOD' );