Show
Ignore:
Timestamp:
04/02/08 11:30:48 (6 years ago)
Author:
tokuhirom
Message:

リクエストオブジェクトを追加

Location:
lang/perl/HTTP-MobileAttribute/trunk
Files:
5 added
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-MobileAttribute/trunk/t/01_request.t

    r8596 r8632  
    11use strict; 
     2use warnings; 
    23use Test::More tests => 9; 
    34 
    4 BEGIN { use_ok 'HTTP::MobileAttribute' } 
     5BEGIN { use_ok 'HTTP::MobileAttribute::Request' } 
    56 
    67# various way to make request 
     
    910 
    1011{ 
    11     my $agent = HTTP::MobileAttribute->new($ua); 
    12     isa_ok $agent, 'HTTP::MobileAttribute'; 
    13     is $agent->user_agent, $ua; 
     12    my $req = HTTP::MobileAttribute::Request->new($ua); 
     13    isa_ok $req, 'HTTP::MobileAttribute::Request::Env'; 
     14    is $req->get('user_agent'), $ua; 
    1415} 
    1516 
    1617{ 
    1718    local $ENV{HTTP_USER_AGENT} = $ua; 
    18     my $agent = HTTP::MobileAttribute->new($ua); 
    19     isa_ok $agent, 'HTTP::MobileAttribute'; 
    20     is $agent->user_agent, $ua; 
     19    my $req = HTTP::MobileAttribute::Request->new($ua); 
     20    isa_ok $req, 'HTTP::MobileAttribute::Request::Env'; 
     21    is $req->get('user_agent'), $ua; 
    2122} 
    2223 
     
    2728    my $header = HTTP::Headers->new; 
    2829    $header->header('User-Agent' => $ua); 
    29     my $agent = HTTP::MobileAttribute->new($header); 
    30     isa_ok $agent, 'HTTP::MobileAttribute'; 
    31     is $agent->user_agent, $ua; 
     30 
     31    my $req = HTTP::MobileAttribute::Request->new($header); 
     32    isa_ok $req, 'HTTP::MobileAttribute::Request::HTTPHeaders'; 
     33    is $req->get('user_agent'), $ua; 
    3234} 
    3335 
     
    4244    package main; 
    4345    my $r = bless { 'User-Agent' => $ua }, 'Apache'; 
    44     my $agent = HTTP::MobileAttribute->new($r); 
    45     isa_ok $agent, 'HTTP::MobileAttribute'; 
    46     is $agent->user_agent, $ua; 
     46    my $req = HTTP::MobileAttribute::Request->new($r); 
     47    isa_ok $req, 'HTTP::MobileAttribute::Request::Apache'; 
     48    is $req->get('User-Agent'), $ua; 
    4749}