X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F08error.t;fp=t%2F08error.t;h=18b6065c9e8ee757ddaa9765ccbae968182ab2d7;hb=4e0afe7d97956e05cea8332e2c9b9a9b6457ff1d;hp=0000000000000000000000000000000000000000;hpb=a3875fc653f35e556f0dd181e7c27f30a228a634;p=catagits%2FHTTP-Request-AsCGI.git diff --git a/t/08error.t b/t/08error.t new file mode 100644 index 0000000..18b6065 --- /dev/null +++ b/t/08error.t @@ -0,0 +1,28 @@ +#!perl + +use Test::More tests => 6; + +use strict; +use warnings; + +use IO::File; +use HTTP::Request; +use HTTP::Request::AsCGI; + +my $response; + +{ + my $r = HTTP::Request->new( GET => 'http://www.host.com/' ); + my $c = HTTP::Request::AsCGI->new($r); + + $c->setup; + + $response = $c->restore->response; +} + +isa_ok( $response, 'HTTP::Response' ); +is( $response->code, 500, 'Response Code' ); +is( $response->message, 'Internal Server Error', 'Response Message' ); +is( $response->protocol, 'HTTP/1.1', 'Response Protocol' ); +is( $response->content_type, 'text/html', 'Response Content-Type' ); +ok( length($response->content) > 0, 'Response Content' );