| 1 | package TAPx::Parser::Result::Plan; | ||
| 2 | |||
| 3 | 14 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 14 | ▶ | use vars qw($VERSION @ISA); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 14 | ▶ | use TAPx::Parser::Result; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 14 | @ISA = 'TAPx::Parser::Result'; | |
| 8 | |||
| 9 | =head1 NAME | ||
| 10 | |||
| 11 | TAPx::Parser::Result::Plan - Plan result token. | ||
| 12 | |||
| 13 | =head1 VERSION | ||
| 14 | |||
| 15 | Version 0.50_07 | ||
| 16 | |||
| 17 | =cut | ||
| 18 | |||
| 19 | 14 | $VERSION = '0.50_07'; | |
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | This is a subclass of C<TAPx::Parser::Result>. A token of this class will be | ||
| 24 | returned if a plan line is encountered. | ||
| 25 | |||
| 26 | 1..1 | ||
| 27 | ok 1 - woo hooo! | ||
| 28 | |||
| 29 | C<1..1> is the plan. Gotta have a plan. | ||
| 30 | |||
| 31 | =head1 OVERRIDDEN METHODS | ||
| 32 | |||
| 33 | Mainly listed here to shut up the pitiful screams of the pod coverage tests. | ||
| 34 | They keep me awake at night. | ||
| 35 | |||
| 36 | =over 4 | ||
| 37 | |||
| 38 | =item * C<as_string> | ||
| 39 | |||
| 40 | =item * C<raw> | ||
| 41 | |||
| 42 | =back | ||
| 43 | |||
| 44 | =cut | ||
| 45 | |||
| 46 | ############################################################################## | ||
| 47 | |||
| 48 | =head2 Instance methods | ||
| 49 | |||
| 50 | =head3 C<plan> | ||
| 51 | |||
| 52 | if ( $result->is_plan ) { | ||
| 53 | print $result->plan; | ||
| 54 | } | ||
| 55 | |||
| 56 | This is merely a synonym for C<as_string>. | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | 66 | ▶ | sub plan { '1..' . shift->{tests_planned} } |
|
Subroutine
plan: called CC=1 SCAR=0.0
Pod
documented
| |||
| 61 | |||
| 62 | ############################################################################## | ||
| 63 | |||
| 64 | =head3 C<tests_planned> | ||
| 65 | |||
| 66 | my $planned = $result->tests_planned; | ||
| 67 | |||
| 68 | Returns the number of tests planned. For example, a plan of C<1..17> will | ||
| 69 | cause this method to return '17'. | ||
| 70 | |||
| 71 | =cut | ||
| 72 | |||
| 73 | 93 | ▶ | sub tests_planned { shift->{tests_planned} } |
|
Subroutine
tests_planned: called CC=1 SCAR=0.0
Pod
documented
| |||
| 74 | |||
| 75 | ############################################################################## | ||
| 76 | |||
| 77 | =head3 C<directive> | ||
| 78 | |||
| 79 | my $directive = $plan->directive; | ||
| 80 | |||
| 81 | If a SKIP directive is included with the plan, this method will return it. | ||
| 82 | |||
| 83 | 1..0 # SKIP: why bother? | ||
| 84 | |||
| 85 | =cut | ||
| 86 | |||
| 87 | 5 | ▶ | sub directive { shift->{directive} } |
|
Subroutine
directive: called CC=1 SCAR=0.0
Pod
documented
| |||
| 88 | |||
| 89 | ############################################################################## | ||
| 90 | |||
| 91 | =head3 C<has_skip> | ||
| 92 | |||
| 93 | if ( $result->has_skip ) { ... } | ||
| 94 | |||
| 95 | Returns a boolean value indicating whether or not this test has a SKIP | ||
| 96 | directive. | ||
| 97 | |||
| 98 | =head3 C<explanation> | ||
| 99 | |||
| 100 | my $explanation = $plan->explanation; | ||
| 101 | |||
| 102 | If a SKIP directive was included with the plan, this method will return the | ||
| 103 | explanation, if any. | ||
| 104 | |||
| 105 | =cut | ||
| 106 | |||
| 107 | 5 | ▶ | sub explanation { shift->{explanation} } |
|
Subroutine
explanation: called CC=1 SCAR=0.0
Pod
documented
| |||
| 108 | |||
| 109 | 14 | 1; | |