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             {
3             $Password::Policy::Rule::VERSION = '0.02';
4             }
5              
6 5     5   2770 use strict;
  5         12  
  5         161  
7 5     5   25 use warnings;
  5         8  
  5         138  
8              
9 5     5   3072 use Password::Policy::Exception::EmptyPassword;
  5         18  
  5         942  
10              
11             sub new {
12 11     11 0 188 my $class = shift;
13 11   100     94 my $arg = shift || 0;
14              
15 11         57 my $self = bless {
16             arg => $arg
17             } => $class;
18 11         39 return $self;
19             }
20              
21             sub arg {
22 37     37 0 103 my $self = shift;
23 37   66     279 return $self->{arg} || $self->default_arg;
24             }
25              
26 0     0 0 0 sub check { return "This was not implemented properly."; }
27 14     14 0 155 sub default_arg { return 1; }
28              
29             sub prepare {
30 32     32 0 57 my ($self, $password) = @_;
31 32   66     221 return $password || Password::Policy::Exception::EmptyPassword->throw;
32             }
33              
34             1;
35              
36              
37              
38             =pod
39              
40             =head1 NAME
41              
42             Password::Policy::Rule
43              
44             =head1 VERSION
45              
46             version 0.02
47              
48             =head1 AUTHOR
49              
50             Andrew Nelson
51              
52             =head1 COPYRIGHT AND LICENSE
53              
54             This software is copyright (c) 2012 by Andrew Nelson.
55              
56             This is free software; you can redistribute it and/or modify it under
57             the same terms as the Perl 5 programming language system itself.
58              
59             =cut
60              
61              
62             __END__