File Coverage

blib/lib/Path/IsDev/Heuristic/TestDir.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1 7     7   2620 use 5.008; # utf8
  7         17  
2 7     7   24 use strict;
  7         7  
  7         113  
3 7     7   22 use warnings;
  7         9  
  7         135  
4 7     7   541 use utf8;
  7         15  
  7         29  
5              
6             package Path::IsDev::Heuristic::TestDir;
7              
8             our $VERSION = '1.001003';
9              
10             # ABSTRACT: Determine if a path contains a t/ or xt/ directory
11              
12             our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
13              
14              
15              
16              
17              
18              
19              
20              
21              
22              
23              
24              
25              
26              
27              
28              
29 7     7   771 use Role::Tiny::With qw( with );
  7         3871  
  7         829  
30              
31             with 'Path::IsDev::Role::Heuristic', 'Path::IsDev::Role::Matcher::Child::Exists::Any::Dir';
32              
33              
34              
35              
36              
37              
38              
39              
40              
41              
42             sub dirs {
43 6     6 1 25 return qw( xt t );
44             }
45              
46              
47              
48              
49              
50              
51              
52              
53              
54             sub matches {
55 6     6 1 11 my ( $self, $result_object ) = @_;
56 6 100       13 if ( $self->child_exists_any_dir( $result_object, $self->dirs ) ) {
57 1         15 $result_object->result(1);
58 1         6 return 1;
59             }
60 5         19 return;
61             }
62              
63             1;
64              
65             __END__