[prev] [thread] [next] [lurker] [Date index for 2005/02/03]
Author: simon Date: 2005-02-03 17:05:09 +0000 (Thu, 03 Feb 2005) New Revision: 1808 Added: trunk/Email-Store/t/01basic.t trunk/Email-Store/t/05addressings.t trunk/Email-Store/t/06attach.t trunk/Email-Store/t/07date.t trunk/Email-Store/t/08limit.t Removed: trunk/Email-Store/t/1.t trunk/Email-Store/t/2.t trunk/Email-Store/t/attach.t trunk/Email-Store/t/date.t trunk/Email-Store/t/limit.t Modified: trunk/Email-Store/MANIFEST Log: Rejig tests Modified: trunk/Email-Store/MANIFEST =================================================================== --- trunk/Email-Store/MANIFEST 2005-02-03 16:32:43 UTC (rev 1807) +++ trunk/Email-Store/MANIFEST 2005-02-03 17:05:09 UTC (rev 1808) @@ -5,14 +5,14 @@ MANIFEST MANIFEST.SKIP README -t/1.t -t/2.t +t/01basic.t +t/05addressings.t +t/06attach.t +t/07date.t +t/08limit.t t/attach-test -t/attach.t -t/date.t t/date-test t/date-test2 -t/limit.t t/troublesome lib/Email/Store/Attachment.pm lib/Email/Store/Date.pm Copied: trunk/Email-Store/t/01basic.t (from rev 1805, trunk/Email-Store/t/1.t) Copied: trunk/Email-Store/t/05addressings.t (from rev 1805, trunk/Email-Store/t/2.t) Copied: trunk/Email-Store/t/06attach.t (from rev 1805, trunk/Email-Store/t/attach.t) Copied: trunk/Email-Store/t/07date.t (from rev 1805, trunk/Email-Store/t/date.t) Copied: trunk/Email-Store/t/08limit.t (from rev 1805, trunk/Email-Store/t/limit.t) Deleted: trunk/Email-Store/t/1.t =================================================================== --- trunk/Email-Store/t/1.t 2005-02-03 16:32:43 UTC (rev 1807) +++ trunk/Email-Store/t/1.t 2005-02-03 17:05:09 UTC (rev 1808) @@ -1,50 +0,0 @@ -use Test::More tests => 20; -use File::Slurp; -BEGIN { unlink("t/test.db"); } -use Email::Store "dbi:SQLite:dbname=t/test.db"; -#use Email::Store "dbi:mysql:mailstore"; -Email::Store->setup; -ok(1, "Set up"); - -my $data = read_file("mailman-test"); -Email::Store::Mail->store($data); - -# We need one mail: -my @mails = Email::Store::Mail->retrieve_all; -is(@mails, 1, "Only one mail"); -is($mails[0]->message_id, '20001128211546.A29664@xxxxxxxxx.xxx', "Correct ID"); -like($mails[0]->message, qr/PRE_PROCESS/, "Contains the right stuff"); - -my $simple = $mails[0]->simple; -isa_ok($simple, "Email::Simple"); -is($simple, $mails[0]->simple, "Email::Simple objects should be singleton"); - -# Subject munged correctly -is($simple->header("Subject"), "ttree problems - the sequel", "Subject had relevant bits removed"); - -# And one list: -my @lists = Email::Store::List->retrieve_all; -is(@lists, 1, "Only one list"); -my $list = shift @lists; -is ($list->name, "templates", "Good name"); -is ($list->posting_address, 'templates@xxxxxxxxxxxxxxxx.xxx', "Good address"); - -# List should have one post: -is($list->posts, 1, "One post"); -# And the post should belong to a list! -is(($mails[0]->lists)[0], $list, "Belongs to correct list"); - -# Now I expect there to be two entities in the world -my @entities = Email::Store::Entity->retrieve_all; -is(@entities, 2, "Two people in our universe"); -for (@entities) { - my @addressings = $_->addressings; - is (@addressings, 1, "One addressing each"); - is ($addressings[0]->mail, $mails[0], "Referring to the right mail"); -} - -# Dates: -my $date; -ok($date = $mails[0]->date ); -is (($date - $date->tzoffset)->ymd,"2000-11-28"); -is (($date - $date->tzoffset)->hms,"21:15:46"); Deleted: trunk/Email-Store/t/2.t =================================================================== --- trunk/Email-Store/t/2.t 2005-02-03 16:32:43 UTC (rev 1807) +++ trunk/Email-Store/t/2.t 2005-02-03 17:05:09 UTC (rev 1808) @@ -1,19 +0,0 @@ -use Test::More tests => 4; -use File::Slurp; -BEGIN { unlink("t/test.db"); } -use Email::Store "dbi:SQLite:dbname=t/test.db"; -#use Email::Store "dbi:mysql:mailstore"; -Email::Store->setup; -ok(1, "Set up"); - -my $data = read_file("t/troublesome"); -Email::Store::Mail->store($data); - -# We need one mail: -my @mails = Email::Store::Mail->retrieve_all; -is(@mails, 1, "Only one mail"); -my $mail = $mails[0]; - -my @addressings = $mail->addressings(role => "To"); -is(@addressings, 0, "No real addresses"); -is(($mail->date - $mail->date->tzoffset)->ymd, "2002-07-12"); Deleted: trunk/Email-Store/t/attach.t =================================================================== --- trunk/Email-Store/t/attach.t 2005-02-03 16:32:43 UTC (rev 1807) +++ trunk/Email-Store/t/attach.t 2005-02-03 17:05:09 UTC (rev 1808) @@ -1,19 +0,0 @@ -use Test::More tests => 8; -use File::Slurp; -BEGIN { unlink("t/test.db"); } -use Email::Store - ("dbi:SQLite:dbname=t/test.db", "", "", { sqlite_handle_binary_nulls => 1 } ); -Email::Store->setup; -ok(1, "Set up"); - -my $data = read_file("t/attach-test"); -my $mail = Email::Store::Mail->store($data); -my @att = $mail->attachments; -is (@att, 2, "Has two attachments"); -my $msg = $mail->message; -like ($msg, qr/pointless/, "Message with crap stripped"); -unlike ($msg, qr/OkoQfvUzL/, "Message with crap stripped"); -is($att[0]->content_type, "application/x-tex"); -is($att[0]->filename, "foo.tex"); -is($att[0]->payload, "Foo bar baz\n\n"); -is($att[1]->content_type, "image/png"); Deleted: trunk/Email-Store/t/date.t =================================================================== --- trunk/Email-Store/t/date.t 2005-02-03 16:32:43 UTC (rev 1807) +++ trunk/Email-Store/t/date.t 2005-02-03 17:05:09 UTC (rev 1808) @@ -1,39 +0,0 @@ -use Test::More tests => 11; -use File::Slurp; -BEGIN { unlink("t/test.db"); } -use Email::Store "dbi:SQLite:dbname=t/test.db"; -Email::Store->setup; -ok(1, "Set up"); - -my $data = read_file("t/date-test"); -Email::Store::Mail->store($data); - -# We need one mail: -my @mails = Email::Store::Mail->retrieve_all; -is(@mails, 1, "Only one mail"); -# is($mails[0]->message_id, '20001128211546.A29664@xxx.xxx', "Correct ID"); - -my $date; - -ok($date = $mails[0]->date ); - - -is ($date->ymd,"2004-06-18"); -is ($date->hms,"11:14:35"); -is ($mails[0]->year,"2004"); -is ($mails[0]->month,"6"); -is ($mails[0]->day,"18"); - -$data = read_file("t/date-test2"); -Email::Store::Mail->store($data); - -@mails = Email::Store::Mail->retrieve_all; -is(@mails, 2, "now two mails"); - -my @searched = Email::Store::Mail->search_between(1087516800,1087603199); - -is(@searched, 1, "Search only found one mail"); - -@searched = Email::Store::Mail->search_between(1087516800,1087689600); -is(@searched, 2, "Search found two mails"); - Deleted: trunk/Email-Store/t/limit.t =================================================================== --- trunk/Email-Store/t/limit.t 2005-02-03 16:32:43 UTC (rev 1807) +++ trunk/Email-Store/t/limit.t 2005-02-03 17:05:09 UTC (rev 1808) @@ -1,21 +0,0 @@ -use Test::More tests => 4; -use File::Slurp; -BEGIN { unlink("t/test.db"); } - -use Email::Store { only => [ "Mail" ] }, "dbi:SQLite:dbname=t/test.db"; -#use Email::Store "dbi:mysql:mailstore"; -Email::Store->setup; -ok(1, "Set up"); - -my $data = read_file("t/troublesome"); -Email::Store::Mail->store($data); - -# We need one mail: -my @mails = Email::Store::Mail->retrieve_all; -is(@mails, 1, "Only one mail"); -my $mail = $mails[0]; - - -is(Email::Store::Mail->can('date'),undef,"limited"); -my $var = Email::Store::Mail->can('simple'); -is(ref($var),'CODE',"limited allowed");
Generated at 05:00 on 04 Feb 2005 by mariachi 0.52