aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-18 12:02:59 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-18 12:02:59 +1300
commitcb5390134daeddaf755d8cc19c3fecc81ef8f209 (patch)
treec93a1158d2bc9c19bf068debb6f65573ec1ca6e9 /t
parentAdd a test of `mailto` constructor requirement (diff)
downloadMail-Run-Crypt-cb5390134daeddaf755d8cc19c3fecc81ef8f209.tar.gz (sig)
Mail-Run-Crypt-cb5390134daeddaf755d8cc19c3fecc81ef8f209.zip
Add more tests, bump versionv0.06
This is still really only testing that the object constructed in the right way and is providing the expected interface and internals as functions. It needs to actually run as much as possible. I still have to figure out how to mock that up cleanly.
Diffstat (limited to 't')
-rw-r--r--t/encrypt.t27
-rw-r--r--t/instantiate.t15
-rw-r--r--t/require-mailto.t2
3 files changed, 28 insertions, 16 deletions
diff --git a/t/encrypt.t b/t/encrypt.t
new file mode 100644
index 0000000..2248579
--- /dev/null
+++ b/t/encrypt.t
@@ -0,0 +1,27 @@
+#!perl -T
+
+use strict;
+use warnings;
+use utf8;
+
+use Test::More tests => 12;
+
+use Mail::Run::Crypt;
+
+our $VERSION = '0.06';
+
+my $mrc = Mail::Run::Crypt->new( mailto => 'nobody@example.com' );
+
+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' );
+ok( $mrc->bail == $Mail::Run::Crypt::DEFAULT_EXIT, 'bail_default_exit' );
+ok( $mrc->{mailto} eq 'nobody@example.com', 'mailto_set' );
+ok( $mrc->{encrypt} == 1, 'encrypt_on' );
+ok( $mrc->{sign} == 0, 'sign_off' );
+ok( $mrc->{name} eq 'Mail::Run::Crypt', 'default_name' );
+ok( !defined $mrc->{keyid}, 'keyid unset' );
+ok( !defined $mrc->{passphrase}, 'passphrase unset' );
diff --git a/t/instantiate.t b/t/instantiate.t
deleted file mode 100644
index 6a55fe0..0000000
--- a/t/instantiate.t
+++ /dev/null
@@ -1,15 +0,0 @@
-#!perl -T
-
-use strict;
-use warnings;
-use utf8;
-
-use Test::More tests => 1;
-
-use Mail::Run::Crypt;
-
-our $VERSION = '0.05';
-
-my $mrc = Mail::Run::Crypt->new( mailto => 'nobody@example.com' );
-
-isnt( $mrc, undef, 'instantiate' );
diff --git a/t/require-mailto.t b/t/require-mailto.t
index 9298cec..1f36e3d 100644
--- a/t/require-mailto.t
+++ b/t/require-mailto.t
@@ -9,7 +9,7 @@ use Test::More tests => 2;
use Mail::Run::Crypt;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
my $mrc;
my $error;