root/HTTP-MobileAgent/trunk/t/07_airh.t

Revision 875 (checked in by miyagawa, 17 years ago)

version 0.09

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 use strict;
2
3 use strict;
4 use Test::More tests => 12;
5
6 BEGIN { use_ok 'HTTP::MobileAgent' }
7
8 my @Tests = (
9     # ua, method_hash
10     [ "Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0",
11       name => 'DDIPOCKET', vendor => 'JRC', model => 'AH-J3001V,AH-J3002V',
12       model_version => '1.0', browser_version => '0100', cache_size => 50 ],
13 );
14
15 for (@Tests) {
16     my($ua, %data) = @$_;
17     my $agent = HTTP::MobileAgent->new($ua);
18     isa_ok $agent, 'HTTP::MobileAgent';
19     isa_ok $agent, 'HTTP::MobileAgent::AirHPhone';
20     ok $agent->is_airh_phone;
21
22     for my $key (keys %data) {
23         is $agent->$key(), $data{$key}, "$key is $data{$key}";
24     }
25 }
26
27 while (<DATA>) {
28     next if /^#/;
29     chomp;
30     local $ENV{HTTP_USER_AGENT} = $_;
31     my $agent = HTTP::MobileAgent->new;
32     isa_ok $agent, 'HTTP::MobileAgent', "$_";
33     ok $agent->is_airh_phone;
34 }
35
36 __END__
37 Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0
Note: See TracBrowser for help on using the browser.