aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-18 21:12:28 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-18 21:12:28 +1300
commiteb44deea1bcb5977f37663eea5333d92a6c17a23 (patch)
tree6fb20265a1adb5ece8793d6a3293e016772e2386 /t
parentRemove trailing semicolon (diff)
downloadMail-Run-Crypt-eb44deea1bcb5977f37663eea5333d92a6c17a23.tar.gz
Mail-Run-Crypt-eb44deea1bcb5977f37663eea5333d92a6c17a23.zip
Refactor encryption-mode build test
Diffstat (limited to 't')
-rw-r--r--t/encrypt.t13
1 files changed, 6 insertions, 7 deletions
diff --git a/t/encrypt.t b/t/encrypt.t
index 2248579..3caf8ca 100644
--- a/t/encrypt.t
+++ b/t/encrypt.t
@@ -4,24 +4,23 @@ use strict;
use warnings;
use utf8;
-use Test::More tests => 12;
+use Test::More tests => 10;
use Mail::Run::Crypt;
our $VERSION = '0.06';
-my $mrc = Mail::Run::Crypt->new( mailto => 'nobody@example.com' );
+my %opts = ( mailto => 'nobody@example.com' );
+my $mrc = Mail::Run::Crypt->new(%opts);
my $pkg = 'Mail::Run::Crypt';
ok( defined $mrc, 'constructed' );
isa_ok( $mrc, $pkg );
-can_ok( $pkg, 'run' );
-can_ok( $pkg, 'bail' );
-can_ok( $pkg, '_mail' );
+can_ok( $pkg, 'run', 'bail', '_mail' );
ok( $mrc->bail == $Mail::Run::Crypt::DEFAULT_EXIT, 'bail_default_exit' );
-ok( $mrc->{mailto} eq 'nobody@example.com', 'mailto_set' );
+ok( $mrc->{mailto} eq $opts{mailto}, 'mailto_set' );
ok( $mrc->{encrypt} == 1, 'encrypt_on' );
ok( $mrc->{sign} == 0, 'sign_off' );
-ok( $mrc->{name} eq 'Mail::Run::Crypt', 'default_name' );
+ok( $mrc->{name} eq $pkg, 'default_name' );
ok( !defined $mrc->{keyid}, 'keyid unset' );
ok( !defined $mrc->{passphrase}, 'passphrase unset' );