aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-20 15:08:32 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-20 15:08:32 +1300
commit803f2cfdaddd77c0c6279f112981675d14dd23cd (patch)
tree15fc0e1249fa0e0129e3a9ad766353bf5aea7160
parentAdd test of custom name in constructor (diff)
downloadMail-Run-Crypt-803f2cfdaddd77c0c6279f112981675d14dd23cd.tar.gz
Mail-Run-Crypt-803f2cfdaddd77c0c6279f112981675d14dd23cd.zip
Remove unneeded exists..defined test series
Better test coverage this way and neither `strict` nor `warnings` seems concerned about testing the definedness of a nonexistent key.
-rw-r--r--lib/Mail/Run/Crypt.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Mail/Run/Crypt.pm b/lib/Mail/Run/Crypt.pm
index bd99043..2c33684 100644
--- a/lib/Mail/Run/Crypt.pm
+++ b/lib/Mail/Run/Crypt.pm
@@ -29,7 +29,7 @@ sub new {
my $self = {%opts};
# We must have a recipient
- exists $self->{mailto} and defined $self->{mailto}
+ defined $self->{mailto}
or croak 'mailto required';
# Default the instance name to the package name if it wasn't given;
@@ -42,9 +42,9 @@ sub new {
# If signing, we need a key ID and a passphrase
if ( $self->{sign} ) {
- exists $self->{keyid} and defined $self->{keyid}
+ defined $self->{keyid}
or croak 'keyid required for signing';
- exists $self->{passphrase} and defined $self->{passphrase}
+ defined $self->{passphrase}
or croak 'passphrase required for signing';
}