diff options
Diffstat (limited to 't/tests/sietima/message.t')
-rw-r--r-- | t/tests/sietima/message.t | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/tests/sietima/message.t b/t/tests/sietima/message.t new file mode 100644 index 0000000..d1c548a --- /dev/null +++ b/t/tests/sietima/message.t @@ -0,0 +1,35 @@ +#!perl +use lib 't/lib'; +use Test::Sietima; +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', +); + +# I'm not sure I'll need 'clone', so I won't test it for the moment + +done_testing; |