diff options
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, |