line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Pcuke::Gherkin::Node::Outline; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
84508
|
use warnings; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
113
|
|
4
|
3
|
|
|
3
|
|
39
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
189
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
22
|
use base 'Test::Pcuke::Gherkin::Node'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
2148
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Test::Pcuke::Gherkin::Node::Outline - Scenario Outline class |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
TODO SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
use Test::Pcuke::Gherkin::Node::Outline; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $outline = Test::Pcuke::Gherkin::Node::Outline->new(); |
19
|
|
|
|
|
|
|
# TODO code example |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 new |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
6
|
|
|
6
|
1
|
4935
|
my ($class, $args) = @_; |
29
|
|
|
|
|
|
|
|
30
|
6
|
|
|
|
|
34
|
$args->{'_nsteps'} = {pass=>0, fail=>0, undef=>0 }; |
31
|
6
|
|
|
|
|
22
|
$args->{'_nscenarios'} = {pass=>0, fail=>0, undef=>0 }; |
32
|
|
|
|
|
|
|
|
33
|
6
|
|
|
|
|
49
|
my $self = $class->SUPER::new( |
34
|
|
|
|
|
|
|
immutables => [qw{title}], |
35
|
|
|
|
|
|
|
properties => [qw{_nsteps _nscenarios examples steps}], |
36
|
|
|
|
|
|
|
args => $args, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
6
|
|
|
|
|
24
|
return $self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub set_title { |
43
|
2
|
|
|
2
|
0
|
48
|
my ($self, $title) = @_; |
44
|
2
|
|
|
|
|
16
|
$self->_set_immutable('title', $title); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
2
|
0
|
48
|
sub title { $_[0]->_get_immutable('title') } |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub add_examples { |
50
|
6
|
|
|
6
|
0
|
32
|
my ($self, $examples) = @_; |
51
|
6
|
|
|
|
|
18
|
$self->_add_property('examples', $examples); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
5
|
|
|
5
|
0
|
22
|
sub examples { $_[0]->_get_property('examples') } |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub add_step { |
57
|
2
|
|
|
2
|
0
|
988
|
my ($self, $step) = @_; |
58
|
2
|
|
|
|
|
13
|
$self->_add_property('steps', $step); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub execute { |
62
|
3
|
|
|
3
|
0
|
19
|
my ($self, $background) = @_; |
63
|
3
|
|
|
|
|
8
|
my $scenarioses = $self->examples; |
64
|
3
|
|
|
|
|
10
|
my $steps = $self->_get_property('steps'); |
65
|
|
|
|
|
|
|
|
66
|
3
|
|
|
|
|
7
|
for ( @$scenarioses ){ |
67
|
6
|
|
|
|
|
30
|
$_->execute( $steps, $background ); |
68
|
6
|
|
|
|
|
2817
|
$self->collect_stats( $_ ); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub collect_stats { |
73
|
6
|
|
|
6
|
0
|
11
|
my ($self, $scenarios) = @_; |
74
|
6
|
|
|
|
|
15
|
my $nsteps = $self->nsteps; |
75
|
6
|
|
|
|
|
17
|
my $nscenarios = $self->nscenarios; |
76
|
|
|
|
|
|
|
|
77
|
6
|
|
|
|
|
27
|
my $asteps = $scenarios->nsteps; |
78
|
6
|
|
|
|
|
411
|
my $ascenarios = $scenarios->nscenarios; |
79
|
|
|
|
|
|
|
|
80
|
6
|
|
|
|
|
379
|
for (qw{pass fail undef}) { |
81
|
18
|
|
|
|
|
32
|
$nsteps->{$_} += $asteps->{$_}; |
82
|
18
|
|
|
|
|
37
|
$nscenarios->{$_} += $ascenarios->{$_}; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
6
|
|
|
|
|
22
|
$self->_set_property('_nsteps', $nsteps); |
86
|
6
|
|
|
|
|
16
|
$self->_set_property('_nscenarios', $nscenarios); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
2
|
|
|
2
|
0
|
16
|
sub steps { $_[0]->_get_property('steps'); } |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub nsteps { |
92
|
7
|
|
|
7
|
0
|
14
|
my ($self, $status) = @_; |
93
|
7
|
|
|
|
|
22
|
my $nsteps = $self->_get_property('_nsteps'); |
94
|
7
|
50
|
|
|
|
37
|
return $status ? |
95
|
|
|
|
|
|
|
$nsteps->{$status} |
96
|
|
|
|
|
|
|
: $nsteps; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub nscenarios { |
100
|
7
|
|
|
7
|
0
|
10
|
my ($self, $status) = @_; |
101
|
7
|
|
|
|
|
20
|
my $nscenarios = $self->_get_property('_nscenarios'); |
102
|
|
|
|
|
|
|
|
103
|
7
|
50
|
|
|
|
27
|
return $status ? |
104
|
|
|
|
|
|
|
$nscenarios->{$status} |
105
|
|
|
|
|
|
|
: $nscenarios; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; # End of Test::Pcuke::Gherkin::Node::Outline |
111
|
|
|
|
|
|
|
=head1 AUTHOR |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Andrei V. Toutoukine, C<< >> |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 BUGS |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
118
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
119
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 SUPPORT |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
perldoc Test::Pcuke::Gherkin::Node::Outline |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
You can also look for information at: |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=over 4 |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
L |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
L |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item * CPAN Ratings |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
L |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item * Search CPAN |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
L |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=back |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Copyright 2011 Andrei V. Toutoukine. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
This program is released under the following license: artistic |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=cut |
165
|
|
|
|
|
|
|
|