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             {
3             $Password::Policy::Exception::VERSION = '0.02';
4             }
5              
6 12     12   44245 use strict;
  12         24  
  12         523  
7 12     12   66 use warnings;
  12         29  
  12         881  
8              
9             use overload
10 21     21   1325 '""' => sub { shift->error },
11 12     12   16530 'cmp' => \&_three_way_compare;
  12         11582  
  12         157  
12              
13              
14 21     21 0 244 sub new { bless {} => shift; }
15 1     1 0 11 sub error { return "An unspecified exception was thrown."; }
16 21     21 0 217 sub throw { die shift->new; }
17              
18             sub _three_way_compare {
19 0     0     my $self = shift;
20 0   0       my $other = shift || '';
21 0           return $self->error cmp "$other";
22             }
23              
24             1;
25              
26              
27              
28             =pod
29              
30             =head1 NAME
31              
32             Password::Policy::Exception
33              
34             =head1 VERSION
35              
36             version 0.02
37              
38             =head1 AUTHOR
39              
40             Andrew Nelson
41              
42             =head1 COPYRIGHT AND LICENSE
43              
44             This software is copyright (c) 2012 by Andrew Nelson.
45              
46             This is free software; you can redistribute it and/or modify it under
47             the same terms as the Perl 5 programming language system itself.
48              
49             =cut
50              
51              
52             __END__