File Coverage

blib/lib/Password/Policy/Rule.pm
Criterion Covered Total %
statement 18 19 94.7
branch n/a
condition 6 8 75.0
subroutine 7 8 87.5
pod 0 5 0.0
total 31 40 77.5


line stmt bran cond sub pod time code
1             package Password::Policy::Rule;
2             $Password::Policy::Rule::VERSION = '0.06';
3 8     8   3980 use strict;
  8         46  
  8         326  
4 8     8   46 use warnings;
  8         13  
  8         490  
5              
6 8     8   3106 use Password::Policy::Exception::EmptyPassword;
  8         22  
  8         1637  
7              
8             sub new {
9 33     33 0 1438063 my $class = shift;
10 33   100     127 my $arg = shift || 0;
11              
12 33         107 my $self = bless {
13             arg => $arg
14             } => $class;
15 33         121 return $self;
16             }
17              
18             sub arg {
19 60     60 0 140 my $self = shift;
20 60   66     362 return $self->{arg} || $self->default_arg;
21             }
22              
23 0     0 0 0 sub check { return "This was not implemented properly."; }
24 14     14 0 90 sub default_arg { return 1; }
25              
26             sub prepare {
27 55     55 0 129 my ($self, $password) = @_;
28 55   66     262 return $password || Password::Policy::Exception::EmptyPassword->throw;
29             }
30              
31             1;
32              
33             __END__