Fetching Output is Also Easy


my @mails;
Test::MockObject->fake_module( 'Mail::Mailer', new => sub {
    push @mails, FakeMail->new();
    return $mails[-1];
});

my $mail = shift @mails;
is( $mail->To(), 'you@elsewhere',
    '*new* list should notify added users' );

< | toc | >