use strict;
use warnings;
use 5.020;
use lib 't/lib';
use Test2::Bundle::Extended;
use Test2::Plugin::DieOnFail;
use Email::Stuffer;
use Sietima::Message;
my $mail = Email::Stuffer
->from('one@example.com')
->to('two@example, three@example.com')
->text_body('test message')->email;
my $message = Sietima::Message->new({
mail => $mail,
from => 'one@envelope.example.com',
to => [
'two@envelope.example.com',
'three@envelope.example.com',
],
});
is(
$message->envelope,
{
from => 'one@envelope.example.com',
to => bag {
item 'two@envelope.example.com';
item 'three@envelope.example.com';
},
},
'the envelope should be built from the attributes',
);
done_testing;