--- trunk/t/1_nos.t 2005/05/16 22:04:40 31 +++ trunk/t/1_nos.t 2005/05/16 22:32:58 32 @@ -3,14 +3,25 @@ use strict; use blib; -use Test::More tests => 5; +use Test::More tests => 23; BEGIN { use_ok('Nos') }; ok(my $nos = new Nos('dsn' => 'dbi:Pg:dbname=notices'), "new"); ok($nos->_add_list( list => 'My list', email => 'my-list@example.com'), "_add_list"); +ok($nos->_get_list('My list'), "_get_list"); -ok($nos->add_member_to_list( list => 'My list', email => 'foo@example.com' ), "add_member_to_list"); +ok($nos->_add_list( list => 'Another list', email => 'list2@example.com'), "_add_list"); +ok($nos->_get_list('Another list'), "_get_list"); -ok($nos->add_message_to_list( list => 'My list', message => 'Subject: test\nJust a test' ), "add_message_to_list"); +foreach my $email (qw(foo@example.com bar@example.com baz@example.com)) { + ok($nos->add_member_to_list( list => 'My list', email => $email ), "add_member_to_list $email"); + ok($nos->add_member_to_list( list => 'Another list', email => $email ), "add_member_to_list $email"); +} + +ok($nos->add_message_to_list( list => 'My list', message => "Subject: test\nJust a test" ), "add_message_to_list"); + +foreach my $i ( 1 .. 10 ) { + ok($nos->add_message_to_list( list => 'Another list', message => "Subject: test $i" ), "add_message_to_list"); +}