| 1 |
#!/usr/bin/perl |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
|
| 5 |
use MIME::Lite; |
| 6 |
use Test::More tests => 2; |
| 7 |
|
| 8 |
$MIME::Lite::VANILLA = 1; |
| 9 |
$MIME::Lite::PARANOID = 1; |
| 10 |
|
| 11 |
my $msg; |
| 12 |
|
| 13 |
$msg = MIME::Lite->new(From => "me", To => "you"); |
| 14 |
$msg->attach(Path => "boguscmd |"); |
| 15 |
$msg->attach(Data => "Hello"); |
| 16 |
$msg->attach(Path => "<path.to.missing.file"); |
| 17 |
eval { $msg->verify_data }; |
| 18 |
|
| 19 |
like($@, qr/path\.to\.missing\.file/, "we detected a missing file"); |
| 20 |
|
| 21 |
$msg = MIME::Lite->new(From=>"me", To=>"you"); |
| 22 |
$msg->attach(Data => "Hello"); |
| 23 |
eval { $msg->verify_data }; |
| 24 |
|
| 25 |
ok(!$@, "we detected NO missing file"); |