Sietima

 view release on metacpan or  search on metacpan

t/tests/sietima/role/nomail.t  view on Meta::CPAN

#!perl
use lib 't/lib';
use Test::Sietima;

subtest 'disabled' => sub {
    my $s = make_sietima(
        with_traits => ['NoMail'],
        subscribers => [
            {
                primary => 'one@users.example.com',
                prefs => { wants_mail => 0 },
            },
            'two@users.example.com',
        ],
    );

    test_sending(
        sietima => $s,
        to => ['two@users.example.com'],
    );
};

subtest 'enabled' => sub {
    my $s = make_sietima(
        with_traits => ['NoMail'],
        subscribers => [
            {
                primary => 'one@users.example.com',
                prefs => { wants_mail => 1 },
            },
            'two@users.example.com',
        ],
    );

    test_sending(
        sietima => $s,
        to => ['one@users.example.com','two@users.example.com'],
    );
};

done_testing;



( run in 1.012 second using v1.01-cache-2.11-cpan-ad19def0cd9 )