line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
19295
|
use 5.008001; |
|
9
|
|
|
|
|
30
|
|
|
9
|
|
|
|
|
392
|
|
2
|
9
|
|
|
9
|
|
10438
|
use strictures; |
|
9
|
|
|
|
|
10294
|
|
|
9
|
|
|
|
|
213
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Roo; |
5
|
|
|
|
|
|
|
# ABSTRACT: Composable, reusable tests with roles and Moo |
6
|
|
|
|
|
|
|
our $VERSION = '1.004'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
9
|
|
|
9
|
|
21755
|
use Test::More 0.96 import => [qw/subtest/]; |
|
9
|
|
|
|
|
379261
|
|
|
9
|
|
|
|
|
258
|
|
9
|
|
|
|
|
|
|
|
10
|
9
|
|
|
9
|
|
33537
|
use Sub::Install; |
|
9
|
|
|
|
|
24545
|
|
|
9
|
|
|
|
|
66
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
9
|
|
|
9
|
|
397
|
my ( $class, @args ) = @_; |
14
|
9
|
|
|
|
|
28
|
my $caller = caller; |
15
|
9
|
|
|
|
|
32
|
for my $sub (qw/test top_test run_me/) { |
16
|
27
|
|
|
|
|
2161
|
Sub::Install::install_sub( { into => $caller, code => $sub } ); |
17
|
|
|
|
|
|
|
} |
18
|
9
|
|
|
|
|
504
|
strictures->import; # do this for Moo, since we load Moo in eval |
19
|
9
|
|
|
9
|
|
14107
|
eval qq{ |
|
9
|
|
|
|
|
264049
|
|
|
9
|
|
|
|
|
63
|
|
|
9
|
|
|
|
|
1853
|
|
20
|
|
|
|
|
|
|
package $caller; |
21
|
|
|
|
|
|
|
use Moo; |
22
|
|
|
|
|
|
|
extends 'Test::Roo::Class' |
23
|
|
|
|
|
|
|
}; |
24
|
9
|
100
|
|
|
|
890
|
if (@args) { |
25
|
1
|
|
|
1
|
|
710
|
eval qq{ package $caller; use Test::More \@args }; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
else { |
28
|
8
|
|
|
8
|
|
72
|
eval qq{ package $caller; use Test::More }; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
85
|
|
|
8
|
|
|
|
|
724
|
|
29
|
|
|
|
|
|
|
} |
30
|
9
|
50
|
|
|
|
11743
|
die $@ if $@; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub test { |
34
|
10
|
|
|
10
|
1
|
53314
|
my ( $name, $code ) = @_; |
35
|
10
|
|
|
|
|
122
|
my $caller = caller; |
36
|
|
|
|
|
|
|
my $subtest = sub { |
37
|
13
|
|
|
13
|
|
11466
|
my $self = shift; |
38
|
13
|
|
|
|
|
13566
|
subtest $name => sub { $self->each_test($code) } |
39
|
10
|
|
|
|
|
59
|
}; |
|
13
|
|
|
|
|
130
|
|
40
|
10
|
|
|
|
|
1098
|
eval qq{ package $caller; after _do_tests => \$subtest }; |
41
|
10
|
50
|
|
|
|
22314
|
die $@ if $@; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub top_test { |
45
|
1
|
|
|
1
|
1
|
840
|
my ( $name, $code ) = @_; |
46
|
1
|
|
|
|
|
3
|
my $caller = caller; |
47
|
1
|
|
|
1
|
|
4
|
my $test = sub { shift->each_test($code) }; |
|
1
|
|
|
|
|
16
|
|
48
|
1
|
|
|
|
|
76
|
eval qq{ package $caller; after _do_tests => \$test }; |
49
|
1
|
50
|
|
|
|
3309
|
die $@ if $@; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub run_me { |
53
|
6
|
|
|
6
|
1
|
2044
|
my $class = caller; |
54
|
6
|
|
|
|
|
136
|
$class->run_tests(@_); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# vim: ts=4 sts=4 sw=4 et: |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |