| blib/lib/Parcel/Track/KR/Test.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 20 | 22 | 90.9 |
| branch | 1 | 2 | 50.0 |
| condition | n/a | ||
| subroutine | 7 | 7 | 100.0 |
| pod | 3 | 4 | 75.0 |
| total | 31 | 35 | 88.5 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Parcel::Track::KR::Test; | ||||||
| 2 | # ABSTRACT: Parcel::Track driver for the Regional-Class Test | ||||||
| 3 | |||||||
| 4 | 3 | 3 | 2577 | use utf8; | |||
| 3 | 5 | ||||||
| 3 | 20 | ||||||
| 5 | |||||||
| 6 | 3 | 3 | 95 | use Moo; | |||
| 3 | 6 | ||||||
| 3 | 42 | ||||||
| 7 | |||||||
| 8 | our $VERSION = '0.003'; | ||||||
| 9 | |||||||
| 10 | with 'Parcel::Track::Role::Base'; | ||||||
| 11 | |||||||
| 12 | 3 | 3 | 1004 | use Encode qw( encode_utf8 ); | |||
| 3 | 3 | ||||||
| 3 | 1020 | ||||||
| 13 | |||||||
| 14 | our $URI = 'http://kr-test?tracking_number=%s'; | ||||||
| 15 | |||||||
| 16 | sub BUILDARGS { | ||||||
| 17 | 2 | 2 | 0 | 2369 | my ( $class, @args ) = @_; | ||
| 18 | |||||||
| 19 | 2 | 4 | my %params; | ||||
| 20 | 2 | 50 | 7 | if ( ref $args[0] eq 'HASH' ) { | |||
| 21 | 0 | 0 | %params = %{ $args[0] }; | ||||
| 0 | 0 | ||||||
| 22 | } | ||||||
| 23 | else { | ||||||
| 24 | 2 | 4 | %params = @args; | ||||
| 25 | } | ||||||
| 26 | 2 | 10 | $params{id} =~ s/\D//g; | ||||
| 27 | |||||||
| 28 | 2 | 34 | return \%params; | ||||
| 29 | } | ||||||
| 30 | |||||||
| 31 | 1 | 1 | 1 | 463 | sub uri { sprintf( $URI, $_[0]->id ) } | ||
| 32 | |||||||
| 33 | sub track { | ||||||
| 34 | 1 | 1 | 1 | 3 | my $self = shift; | ||
| 35 | |||||||
| 36 | 1 | 4 | my %result = ( | ||||
| 37 | from => encode_utf8(q{김도형}), | ||||||
| 38 | to => encode_utf8(q{CPAN}), | ||||||
| 39 | result => encode_utf8(q{2015.01.27 도착}), | ||||||
| 40 | htmls => [ | ||||||
| 41 | encode_utf8(q{ 더미 1 }), encode_utf8(q{더미 2 }), |
||||||
| 42 | encode_utf8(q{ 더미 3 }), |
||||||
| 43 | ], | ||||||
| 44 | descs => [ | ||||||
| 45 | encode_utf8(q{2015.01.24. 17:34 접수}), | ||||||
| 46 | encode_utf8(q{2015.01.25. 09:00 광진지점}), | ||||||
| 47 | encode_utf8(q{2015.01.25. 13:01 상차}), | ||||||
| 48 | encode_utf8(q{2015.01.26. 15:23 하차}), | ||||||
| 49 | encode_utf8(q{2015.01.27. 10:45 강동지점}), | ||||||
| 50 | encode_utf8(q{2015.01.27. 16:13 배송완료}), | ||||||
| 51 | ], | ||||||
| 52 | ); | ||||||
| 53 | |||||||
| 54 | 1 | 25 | return \%result; | ||||
| 55 | } | ||||||
| 56 | |||||||
| 57 | 1 | 1 | 1 | 559 | sub clear { 1 } | ||
| 58 | |||||||
| 59 | 1; | ||||||
| 60 | |||||||
| 61 | # | ||||||
| 62 | # This file is part of Parcel-Track | ||||||
| 63 | # | ||||||
| 64 | # This software is copyright (c) 2015 by Keedi Kim. | ||||||
| 65 | # | ||||||
| 66 | # This is free software; you can redistribute it and/or modify it under | ||||||
| 67 | # the same terms as the Perl 5 programming language system itself. | ||||||
| 68 | # | ||||||
| 69 | |||||||
| 70 | __END__ |