aboutsummaryrefslogtreecommitdiff
path: root/t/encrypt.t
blob: 0a790f7a2383927844b3fb41f6d9babb912ba456 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!perl -T

use strict;
use warnings;
use utf8;

use Test::More tests => 10;

use Mail::Run::Crypt;

our $VERSION = '0.10';

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', 'bail', '_mail' );
ok( $mrc->bail == $Mail::Run::Crypt::DEFAULT_EXIT, 'bail_default_exit' );
ok( $mrc->{mailto} eq $opts{mailto},               'mailto_set' );
ok( $mrc->{encrypt} == 1,                          'encrypt_on' );
ok( $mrc->{sign} == 0,                             'sign_off' );
ok( $mrc->{name} eq $pkg,                          'default_name' );
ok( !defined $mrc->{keyid},                        'keyid unset' );
ok( !defined $mrc->{passphrase},                   'passphrase unset' );