Changeset 17525

Show
Ignore:
Timestamp:
08/12/08 17:33:35 (5 years ago)
Author:
yappo
Message:

remove broken writer test case

Location:
lang/perl/HTTP-Engine/trunk/t/010_core
Files:
2 modified

Legend:

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

    r17523 r17525  
    11use strict; 
    22use warnings; 
    3 use Test::More tests => 5; 
     3use Test::More tests => 4; 
    44use IO::Scalar; 
    55use_ok "HTTP::Engine::ResponseWriter"; 
     
    4242 
    4343is $out, $expected; 
    44  
    45  
    46 do { 
    47     my $req = HTTP::Engine::Request->new; 
    48     $req->protocol('HTTP/1.1'); 
    49     $req->method('GET'); 
    50  
    51     my $res = HTTP::Engine::Response->new(status => '200', body => 'OK'); 
    52  
    53     my $rw = HTTP::Engine::ResponseWriter->new(should_write_response_line => 1); 
    54     HTTP::Engine::ResponseFinalizer->finalize( $req, $res ); 
    55  
    56     do { 
    57         local $@; 
    58         no warnings 'redefine'; 
    59         my $write; 
    60         local *HTTP::Engine::ResponseWriter::_write = sub { $write++; undef }; 
    61         $rw->finalize($req, $res); 
    62         ok $write; 
    63     }; 
    64 }; 
  • lang/perl/HTTP-Engine/trunk/t/010_core/responsewriter-with_io.t

    r17444 r17525  
    129129 
    130130".('dummy'x5000) 
     131 
    131132=== 
    132133--- input 
     
    157158 
    158159OK! 
     160 
     161=== 
     162--- input 
     163my $writer = HTTP::Engine::ResponseWriter->new( 
     164    should_write_response_line => 1, 
     165); 
     166 
     167my $tmp = File::Temp->new(); 
     168$tmp->write("OK!"); 
     169$tmp->flush(); 
     170$tmp->seek(0, File::Temp::SEEK_SET); 
     171 
     172my $req = HTTP::Engine::Request->new( 
     173    protocol => 'HTTP/1.1', 
     174    method => 'GET', 
     175); 
     176my $res = HTTP::Engine::Response->new(body => $tmp, status => 200); 
     177 
     178my $write; 
     179do { 
     180    no warnings 'redefine'; 
     181    local *HTTP::Engine::ResponseWriter::_write = sub { warn $write++; undef }; 
     182    $writer->finalize( $req, $res ); 
     183}; 
     184$write ? 'OK' : 'NG'; 
     185 
     186--- expected 
     187OK