rev 1973 - trunk/Email-Store/t

[prev] [thread] [next] [lurker] [Date index for 2006/04/24]

From: simon
Subject: rev 1973 - trunk/Email-Store/t
Date: 14:15 on 24 Apr 2006
Author: simon
Date: 2006-04-24 14:15:44 +0100 (Mon, 24 Apr 2006)
New Revision: 1973

Added:
   trunk/Email-Store/t/06attach2.t
Log:
Add new test


Added: trunk/Email-Store/t/06attach2.t
===================================================================
--- trunk/Email-Store/t/06attach2.t	2006-04-04 09:19:32 UTC (rev 1972)
+++ trunk/Email-Store/t/06attach2.t	2006-04-24 13:15:44 UTC (rev 1973)
@@ -0,0 +1,16 @@
+use Test::More tests => 5;
+use File::Slurp;
+BEGIN { unlink("t/test.db"); }
+use Email::Store { only => [qw( Mail Attachment )] }, 
+    ("dbi:SQLite2:dbname=t/test.db", "", "", { sqlite_handle_binary_nulls => 1 } );
+Email::Store->setup;
+ok(1, "Set up");
+
+my $data = read_file("t/message.out");
+my $mail = Email::Store::Mail->store($data);
+my @att = $mail->attachments;
+is (@att, 1, "Has one attachment");
+my $msg = $mail->message;
+like ($msg, qr/submission/, "Message with crap stripped");
+unlike ($msg, qr/JVBERi0x/, "Message with crap stripped");
+is($att[0]->content_type, "application/pdf");

Generated at 10:00 on 25 Apr 2006 by mariachi 0.52