File Coverage

blib/lib/Password/Policy/Exception.pm
Criterion Covered Total %
statement 13 16 81.2
branch n/a
condition 0 2 0.0
subroutine 7 8 87.5
pod 0 3 0.0
total 20 29 68.9


line stmt bran cond sub pod time code
1             package Password::Policy::Exception;
2             $Password::Policy::Exception::VERSION = '0.04';
3 12     12   19687 use strict;
  12         23  
  12         452  
4 12     12   53 use warnings;
  12         16  
  12         656  
5              
6             use overload
7 27     27   1240 '""' => sub { shift->error },
8 12     12   8604 'cmp' => \&_three_way_compare;
  12         7049  
  12         152  
9              
10              
11 27     27 0 240 sub new { bless {} => shift; }
12 1     1 0 8 sub error { return "An unspecified exception was thrown."; }
13 27     27 0 174 sub throw { die shift->new; }
14              
15             sub _three_way_compare {
16 0     0     my $self = shift;
17 0   0       my $other = shift || '';
18 0           return $self->error cmp "$other";
19             }
20              
21             1;
22              
23             __END__