File Coverage

blib/lib/Enbld/Target/Attribute/CommandTest.pm
Criterion Covered Total %
statement 18 22 81.8
branch 1 4 25.0
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 25 34 73.5


line stmt bran cond sub pod time code
1             package Enbld::Target::Attribute::CommandTest;
2              
3 1     1   1608 use strict;
  1         2  
  1         23  
4 1     1   4 use warnings;
  1         1  
  1         24  
5              
6 1     1   3 use parent qw/Enbld::Target::AttributeExtension::Command/;
  1         1  
  1         3  
7              
8             sub initialize {
9 46     46 0 80 my ( $self, $param ) = @_;
10              
11 46 50       124 if ( ! defined $param ) {
12 46         153 my $make = $self->make_command;
13              
14             $self->{callback} = sub {
15 1     1   8 my $attributes = shift;
16              
17 1         40 return $make . ' ' . $attributes->TestAction;
18 46         302 };
19              
20 46         99 return $self;
21             }
22              
23 0 0       0 if ( $param ) {
24 0         0 $self->SUPER::initialize( $param );
25 0         0 return $self;
26             }
27              
28             # empty string is valid
29 0         0 $self->{is_evaluated}++;
30             }
31              
32             sub validate {
33 2     2 0 7 my ( $self, $string ) = @_;
34              
35             # nothing check now.
36              
37 2         6 return $string;
38             }
39              
40             1;