Changeset 18012
- Timestamp:
- 08/22/08 06:01:29 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Nanto/trunk/t/030_web_plugin/MobileAttribute.t
r18011 r18012 2 2 use warnings; 3 3 use Test::More tests => 2; 4 use Nanto::Web::Plugin::MobileAttribute;4 use t::Utils; 5 5 use HTTP::Engine::Request; 6 6 use HTTP::Engine::RequestBuilder; 7 use Nanto::Web::Plugin::MobileAttribute; 7 8 8 my $req = HTTP:: Engine::Request->new(9 headers => {9 my $req = HTTP::Request->new( 10 GET => '/' => HTTP::Headers->new( 10 11 'User-Agent' => 'DoCoMo/1.0/D504i/c10/TJ', 12 ), 13 ); 14 my $res = HTTP::Engine->new( 15 interface => { 16 module => 'Test', 17 args => {}, 18 request_handler => sub { 19 my $req = shift; 20 isa_ok $req->mobile_attribute, 'HTTP::MobileAttribute::Agent::DoCoMo'; 21 is $req->mobile_attribute->user_agent, 'DoCoMo/1.0/D504i/c10/TJ'; 22 HTTP::Engine::Response->new(status=>200); 23 }, 11 24 }, 12 _connection => {}, 13 request_builder => HTTP::Engine::RequestBuilder->new(), 14 ); 15 isa_ok $req->mobile_attribute, 'HTTP::MobileAttribute::Agent::DoCoMo'; 16 is $req->mobile_attribute->user_agent, 'DoCoMo/1.0/D504i/c10/TJ'; 25 )->run($req); 17 26
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)