diff options
author | dakkar <dakkar@thenautilus.net> | 2016-06-10 14:16:08 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2016-06-10 14:16:08 +0100 |
commit | 8fd1099cd8b9451fd259e73c590bb0f149a33520 (patch) | |
tree | 3a4572bd3f29c2e236114ec2e13159fb6d8c510c /t/tests/sietima.t | |
parent | passes its first test! (diff) | |
download | Sietima-8fd1099cd8b9451fd259e73c590bb0f149a33520.tar.gz Sietima-8fd1099cd8b9451fd259e73c590bb0f149a33520.tar.bz2 Sietima-8fd1099cd8b9451fd259e73c590bb0f149a33520.zip |
more tests!
also, some test library
Diffstat (limited to 't/tests/sietima.t')
-rw-r--r-- | t/tests/sietima.t | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/t/tests/sietima.t b/t/tests/sietima.t index b0367b6..ab6e129 100644 --- a/t/tests/sietima.t +++ b/t/tests/sietima.t @@ -2,7 +2,9 @@ use strict; use warnings; use 5.020; +use lib 't/lib'; use Test2::Bundle::Extended; +use Test2::Tools::MoreCompare qw(bag); use Test2::Plugin::DieOnFail; use Email::Stuffer; use Email::Sender::Transport::Test; @@ -51,11 +53,12 @@ subtest 'no subscribers' => sub { }; subtest 'with subscribers' => sub { + my @subscriber_addresses = ( + 'one@users.example.com', + 'two@users.example.com', + ); my $s = make_sietima( - subscribers => [ - 'one@users.example.com', - 'two@users.example.com', - ], + subscribers => [@subscriber_addresses], ); my $m = make_mail(); @@ -69,7 +72,17 @@ subtest 'with subscribers' => sub { is( \@deliveries, array { - # we'd need a 'bag' comparison check here! + item hash { + field envelope => hash { + field from => $return_path; + field to => bag { + for (@subscriber_addresses) { + item object { call address => $_ }; + } + }; + }; + }; + end(); }, 'there should be two deliveries', np @deliveries, |