line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Cukes::Feature; |
2
|
6
|
|
|
6
|
|
75787
|
use Moose; |
|
6
|
|
|
|
|
2924404
|
|
|
6
|
|
|
|
|
46
|
|
3
|
|
|
|
|
|
|
|
4
|
6
|
|
|
6
|
|
50780
|
use Test::Cukes::Scenario; |
|
6
|
|
|
|
|
25
|
|
|
6
|
|
|
|
|
2638
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has name => ( |
7
|
|
|
|
|
|
|
is => "rw", |
8
|
|
|
|
|
|
|
required => 1, |
9
|
|
|
|
|
|
|
isa => "Str" |
10
|
|
|
|
|
|
|
); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has body => ( |
13
|
|
|
|
|
|
|
is => "rw", |
14
|
|
|
|
|
|
|
isa => "Str" |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has scenarios => ( |
18
|
|
|
|
|
|
|
is => "rw", |
19
|
|
|
|
|
|
|
isa => "ArrayRef[Test::Cukes::Scenario]" |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub BUILDARGS { |
23
|
5
|
|
|
5
|
1
|
13
|
my $class = shift; |
24
|
5
|
50
|
33
|
|
|
50
|
if (@_ == 1 && ! ref $_[0]) { |
25
|
5
|
|
|
|
|
15
|
my $text = shift; |
26
|
5
|
|
|
|
|
29
|
my $args = { |
27
|
|
|
|
|
|
|
name => "", |
28
|
|
|
|
|
|
|
body => "", |
29
|
|
|
|
|
|
|
scenarios => [] |
30
|
|
|
|
|
|
|
}; |
31
|
5
|
|
|
|
|
30
|
my @blocks = split /\n\n/, $text; |
32
|
5
|
|
|
|
|
14
|
my $meta = shift @blocks; |
33
|
|
|
|
|
|
|
|
34
|
5
|
50
|
|
|
|
37
|
unless ($meta =~ m/^Feature:\s([^\n]+x?)$(.+)\z/sm) { |
35
|
0
|
|
|
|
|
0
|
die "Cannot extra feature name and body from text:\n----\n$meta\n----\n\n"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
5
|
|
|
|
|
20
|
$args->{name} = $1; |
39
|
5
|
|
|
|
|
17
|
$args->{body} = $2; |
40
|
|
|
|
|
|
|
|
41
|
5
|
|
|
|
|
15
|
for my $scenario_text (@blocks) { |
42
|
5
|
50
|
|
|
|
86
|
unless ($scenario_text =~ s/^ (.+?)$/$1/mg) { |
43
|
0
|
|
|
|
|
0
|
die "Scenario text is not properly indented:\n----\n${scenario_text}\n----\n\n"; |
44
|
|
|
|
|
|
|
} |
45
|
5
|
|
|
|
|
11
|
push @{$args->{scenarios}}, Test::Cukes::Scenario->new($scenario_text) |
|
5
|
|
|
|
|
177
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
5
|
|
|
|
|
174
|
return $args; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
return $class->SUPER::BUILDARGS(@_); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
55
|
6
|
|
|
6
|
|
71
|
no Moose; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
53
|
|
56
|
|
|
|
|
|
|
1; |