line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Cukes::Scenario; |
2
|
7
|
|
|
7
|
|
30202
|
use Any::Moose; |
|
7
|
|
|
|
|
12826160
|
|
|
7
|
|
|
|
|
45
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has name => ( |
5
|
|
|
|
|
|
|
is => "rw", |
6
|
|
|
|
|
|
|
required => 1, |
7
|
|
|
|
|
|
|
isa => "Str" |
8
|
|
|
|
|
|
|
); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has steps => ( |
11
|
|
|
|
|
|
|
is => "rw", |
12
|
|
|
|
|
|
|
required => 1, |
13
|
|
|
|
|
|
|
isa => "ArrayRef[Str]" |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub BUILDARGS { |
17
|
6
|
|
|
6
|
1
|
340
|
my $class = shift; |
18
|
6
|
50
|
33
|
|
|
54
|
if (@_ == 1 && ! ref $_[0]) { |
19
|
6
|
|
|
|
|
10
|
my $scenario_text = shift; |
20
|
6
|
|
|
|
|
35
|
my $args = { |
21
|
|
|
|
|
|
|
name => "", |
22
|
|
|
|
|
|
|
steps => [] |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
6
|
|
|
|
|
51
|
for my $line (split /\n+/, $scenario_text) { |
26
|
24
|
100
|
|
|
|
151
|
if ($line =~ /^Scenario:\s(.+)$/) { |
|
|
50
|
|
|
|
|
|
27
|
6
|
|
|
|
|
23
|
$args->{name} = $1; |
28
|
|
|
|
|
|
|
} elsif ($line =~ /^ (Given|When|Then|And)\s(.+)$/) { |
29
|
18
|
|
|
|
|
24
|
push @{$args->{ steps }}, "$1 $2"; |
|
18
|
|
|
|
|
73
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
6
|
|
|
|
|
228
|
return $args; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
return $class->SUPER::BUILDARGS(@_); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
40
|
7
|
|
|
7
|
|
6320
|
no Any::Moose; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
38
|
|
41
|
|
|
|
|
|
|
1; |