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.03';
3 7     7   2609 use strict;
  7         11  
  7         217  
4 7     7   25 use warnings;
  7         7  
  7         140  
5              
6 7     7   1921 use Password::Policy::Exception::EmptyPassword;
  7         13  
  7         1139  
7              
8             sub new {
9 32     32 0 196 my $class = shift;
10 32   100     100 my $arg = shift || 0;
11              
12 32         126 my $self = bless {
13             arg => $arg
14             } => $class;
15 32         77 return $self;
16             }
17              
18             sub arg {
19 58     58 0 100 my $self = shift;
20 58   66     325 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 74 sub default_arg { return 1; }
25              
26             sub prepare {
27 53     53 0 70 my ($self, $password) = @_;
28 53   66     227 return $password || Password::Policy::Exception::EmptyPassword->throw;
29             }
30              
31             1;
32              
33             __END__