Email::Send::Test::DataDumper - Captures emails sent via Email::Send for testing, with Tie::DataDumper
# Load as normal use Email::Send; use Email::Send::Test::DataDumper; # First, set the filename for Tie::DataDumper $Email::Send::Test::DataDumper::FILENAME = 'sentmail.txt'; # Always clear the email trap before each test to prevent unexpected # results, and thus spurious test results. Email::Send::Test::DataDumper->clear; ### BEGIN YOUR CODE TO BE TESTED (example follows) my $sender = Email::Send->new({ mailer => 'Test::DataDumper', mailer_args => [ 'sentmail.txt' ] }); $sender->send( $message ); ### END YOUR CODE TO BE TESTED # Check that the number and type (and content) of mails # matched what you expect. my @emails = Email::Send::Test::DataDumper->emails; is( scalar(@emails), 1, 'Sent 1 email' ); isa_ok( $emails[0], 'Email::MIME' ); # Email::Simple subclasses pass through
Email::Send::Test::DataDumper is
Nobuo Danjou <nobuo.danjou@gmail.com>
Email::Send::Test, Tie::DataDumper
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Email::Send::Test::DataDumper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Email::Send::Test::DataDumper
CPAN shell
perl -MCPAN -e shell install Email::Send::Test::DataDumper
For more information on module installation, please visit the detailed CPAN module installation guide.