File Coverage

blib/lib/Password/Policy/Rule/Uppercase.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::Uppercase;
2             $Password::Policy::Rule::Uppercase::VERSION = '0.03';
3 2     2   21511 use strict;
  2         4  
  2         80  
4 2     2   10 use warnings;
  2         4  
  2         65  
5              
6 2     2   426 use parent 'Password::Policy::Rule';
  2         257  
  2         13  
7              
8 2     2   1001 use Password::Policy::Exception::InsufficientUppercase;
  2         5  
  2         240  
9              
10             sub check {
11 11     11 0 229 my $self = shift;
12 11         44 my $password = $self->prepare(shift);
13 10         66 my @uppercase = ($password =~ m/[A-Z]/g);
14 10         17 my $count = scalar @uppercase;
15 10 100       34 if($count < $self->arg) {
16 5         32 Password::Policy::Exception::InsufficientUppercase->throw;
17             }
18 5         21 return 1;
19             }
20              
21             1;
22              
23             __END__