|
Revision 8634, 0.7 kB
(checked in by tokuhirom, 5 years ago)
|
|
キャリヤ判別まわりは別モジュールにわける意味やっぱないわ。そして、Class::Component に依存させる意味もないわ。
|
| Line | |
|---|
| 1 | use strict; |
|---|
| 2 | use warnings; |
|---|
| 3 | use Test::Base; |
|---|
| 4 | use HTTP::MobileAttribute; |
|---|
| 5 | HTTP::MobileAttribute->load_plugins(qw/CarrierName/); |
|---|
| 6 | |
|---|
| 7 | plan tests => 1*blocks; |
|---|
| 8 | |
|---|
| 9 | filters { |
|---|
| 10 | input => [qw/get_carrier/], |
|---|
| 11 | }; |
|---|
| 12 | |
|---|
| 13 | sub get_carrier { |
|---|
| 14 | my $ua = shift; |
|---|
| 15 | HTTP::MobileAttribute->new($ua)->carrier_long_name; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | run_is input => 'expected'; |
|---|
| 19 | |
|---|
| 20 | __END__ |
|---|
| 21 | |
|---|
| 22 | === |
|---|
| 23 | --- input: DoCoMo/1.0/NM502i |
|---|
| 24 | --- expected: DoCoMo |
|---|
| 25 | |
|---|
| 26 | === |
|---|
| 27 | --- input: J-PHONE/5.0/V801SA |
|---|
| 28 | --- expected: JPhone |
|---|
| 29 | |
|---|
| 30 | === |
|---|
| 31 | --- input: KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 |
|---|
| 32 | --- expected: EZweb |
|---|
| 33 | |
|---|
| 34 | === |
|---|
| 35 | --- input: Mozilla/2.0 (compatible; Ask Jeeves) |
|---|
| 36 | --- expected: NonMobile |
|---|
| 37 | |
|---|
| 38 | === |
|---|
| 39 | --- input: Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0 |
|---|
| 40 | --- expected: AirHPhone |
|---|
| 41 | |
|---|