Changeset 17302

Show
Ignore:
Timestamp:
08/10/08 00:56:54 (5 years ago)
Author:
tokuhirom
Message:

test H::E::Request directly.

Files:
1 modified

Legend:

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

    r13758 r17302  
    22use warnings; 
    33use Test::More tests => 5; 
    4 use HTTP::Engine::Context; 
     4use HTTP::Engine::Request; 
     5use HTTP::Engine::RequestBuilder; 
    56 
    6 test_req( gen_context()->req->as_http_request ); 
     7test_req( gen_request()->as_http_request ); 
    78 
    8 sub gen_context { 
    9     my $c = HTTP::Engine::Context->new; 
    10     $c->req->method('POST'); 
    11     $c->req->uri('/foo'); 
    12     $c->req->content_type('application/octet-stream'); 
    13     $c->req->raw_body('foo=bar'); 
    14     $c; 
     9sub gen_request { 
     10    my $req = HTTP::Engine::Request->new( 
     11        request_builder => HTTP::Engine::RequestBuilder->new, 
     12    ); 
     13    $req->method('POST'); 
     14    $req->uri('/foo'); 
     15    $req->content_type('application/octet-stream'); 
     16    $req->raw_body('foo=bar'); 
     17    $req; 
    1518} 
    1619