3 use Test::More tests => 12;
10 use HTTP::Request::AsCGI;
15 my $r = HTTP::Request->new( GET => 'http://www.host.com/' );
16 my $c = HTTP::Request::AsCGI->new($r);
20 $response = $c->restore->response;
23 isa_ok( $response, 'HTTP::Response' );
24 is( $response->code, 500, 'Response Code' );
25 is( $response->message, 'Internal Server Error', 'Response Message' );
26 is( $response->protocol, 'HTTP/1.1', 'Response Protocol' );
27 is( $response->content_type, 'text/html', 'Response Content-Type' );
28 ok( length($response->content) > 0, 'Response Content' );
31 my $r = HTTP::Request->new( GET => 'http://www.host.com/' );
32 my $c = HTTP::Request::AsCGI->new($r);
36 print "Content-Type: text/plain\n";
37 print "Status: 500 Borked\n";
41 $response = $c->restore->response;
44 isa_ok( $response, 'HTTP::Response' );
45 is( $response->code, 500, 'Response Code' );
46 is( $response->message, 'Borked', 'Response Message' );
47 is( $response->protocol, 'HTTP/1.1', 'Response Protocol' );
48 is( $response->content_type, 'text/plain', 'Response Content-Type' );
49 is( $response->content, 'Borked!', 'Response Content' );