File Coverage

blib/lib/Password/Policy/Rule/Lowercase.pm
Criterion Covered Total %
statement 19 19 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 26 27 96.3


line stmt bran cond sub pod time code
1             package Password::Policy::Rule::Lowercase;
2             $Password::Policy::Rule::Lowercase::VERSION = '0.06';
3 2     2   133272 use strict;
  2         5  
  2         88  
4 2     2   10 use warnings;
  2         10  
  2         120  
5              
6 2     2   556 use parent 'Password::Policy::Rule';
  2         412  
  2         13  
7              
8 2     2   1098 use Password::Policy::Exception::InsufficientLowercase;
  2         6  
  2         274  
9              
10             sub check {
11 9     9 0 351 my $self = shift;
12 9         37 my $password = $self->prepare(shift);
13 8         63 my @lowercase = ($password =~ m/[a-z]/g);
14 8         15 my $count = scalar @lowercase;
15 8 100       26 if($count < $self->arg) {
16 3         17 Password::Policy::Exception::InsufficientLowercase->throw;
17             }
18 5         24 return 1;
19             }
20              
21             1;
22              
23             __END__