Changeset 8632 for lang/perl/HTTP-MobileAttribute/trunk
- Timestamp:
- 04/02/08 11:30:48 (5 years ago)
- Location:
- lang/perl/HTTP-MobileAttribute/trunk
- Files:
-
- 5 added
- 1 modified
-
lib/HTTP/MobileAttribute/Request (added)
-
lib/HTTP/MobileAttribute/Request.pm (added)
-
lib/HTTP/MobileAttribute/Request/Apache.pm (added)
-
lib/HTTP/MobileAttribute/Request/Env.pm (added)
-
lib/HTTP/MobileAttribute/Request/HTTPHeaders.pm (added)
-
t/01_request.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-MobileAttribute/trunk/t/01_request.t
r8596 r8632 1 1 use strict; 2 use warnings; 2 3 use Test::More tests => 9; 3 4 4 BEGIN { use_ok 'HTTP::MobileAttribute ' }5 BEGIN { use_ok 'HTTP::MobileAttribute::Request' } 5 6 6 7 # various way to make request … … 9 10 10 11 { 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; 14 15 } 15 16 16 17 { 17 18 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; 21 22 } 22 23 … … 27 28 my $header = HTTP::Headers->new; 28 29 $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; 32 34 } 33 35 … … 42 44 package main; 43 45 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; 47 49 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)