aboutsummaryrefslogtreecommitdiff
path: root/t/tests/sietima/message.t
blob: d1c548a8c47a324113c6b32dccb685d80457a2d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;