Show
Ignore:
Timestamp:
08/11/08 18:27:16 (5 years ago)
Author:
yappo
Message:

add more test ResponseWriter?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-Engine/trunk/t/010_core/responsewriter-with_io.t

    r17410 r17424  
    5858 
    5959OK! 
     60 
     61=== 
     62--- input 
     63my $writer = HTTP::Engine::ResponseWriter->new( 
     64    should_write_response_line => 1, 
     65); 
     66 
     67tie *STDOUT, 'IO::Scalar', \my $out; 
     68 
     69my $req = HTTP::Engine::Request->new( 
     70    protocol => 'HTTP/1.1', 
     71    method => 'GET', 
     72); 
     73my $res = HTTP::Engine::Response->new(body => 'OK!', status => 200); 
     74$res->header( Connection => 'keepalive' ); 
     75HTTP::Engine::ResponseFinalizer->finalize( $req, $res ); 
     76$writer->finalize($req, $res); 
     77 
     78untie *STDOUT; 
     79 
     80$out; 
     81--- expected 
     82HTTP/1.1 200 OK 
     83Connection: keepalive 
     84Content-Length: 3 
     85Content-Type: text/html 
     86Status: 200 
     87 
     88OK!