BEGIN { plan
tests
=> 6 };
-d
'/tmp/MTA_test_dir'
or
die
<<EOF;
MUST CREATE /tmp/MTA_test_dir DIRECTORY
for instance by installing TipJar::MTA
EOF
ok(1);
ok(
my
$m
= new TipJar::MTA::queue);
my
(
$sec
,
$min
,
$hour
,
$mday
,
$mon
,
$year
,
$wday
,
$yday
)
=
gmtime
(
time
);
$year
+= 1900;
$wday
= [
qw/Sun Mon Tue Wed Thu Fri Sat/
]->[
$wday
];
$mon
= [
qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/
]->[
$mon
];
$hour
=
substr
(
"0$hour"
, -2);
$min
=
substr
(
"0$min"
, -2);
$sec
=
substr
(
"0$sec"
, -2);
ok(
$m
->return_address(
'<>'
));
ok(
$m
->recipient([[[
'davidnico@cpan.org'
],
'mta_queue_test_recipient@davidnicol.com'
]]));
ok(
$m
->data(
<<EOF ));
Date: $wday, $mday $mon $year $hour:$min:$sec +0000
X-This-Is: the message sent from the TipJar::MTA::queue test script
To: "TipJar::MTA::queue author" <davidnico\@cpan.org>
From: "MTA Q. Module Tester" <$ENV{USER}\@$ENV{HOSTNAME}>
Subject: TipJar::MTA::queue test success
$ENV{USER}\@$ENV{HOSTNAME}
has succeeded in installing TipJar::MTA::queue,
or at least in running the test script.
OSTYPE: $ENV{OSTYPE}
EOF
ok(
$m
->enqueue());