/[notice-sender]/trunk/t/1_nos.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/1_nos.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 36 - (hide annotations)
Tue May 17 17:49:14 2005 UTC (19 years ago) by dpavlin
File MIME type: application/x-troff
File size: 1237 byte(s)
work on inbox option

1 dpavlin 20 #!/usr/bin/perl -w
2    
3     use strict;
4     use blib;
5    
6 dpavlin 36 use Test::More tests => 28;
7 dpavlin 31
8 dpavlin 24 BEGIN { use_ok('Nos') };
9 dpavlin 20
10 dpavlin 24 ok(my $nos = new Nos('dsn' => 'dbi:Pg:dbname=notices'), "new");
11 dpavlin 25
12 dpavlin 33 ok($nos->new_list( list => 'My list', email => 'my-list@example.com'), "new_list my-list");
13 dpavlin 36 ok($nos->new_list( list => 'another', email => 'another@example.com'), "new_list another");
14     ok($nos->new_list( list => 'test', email => 'test@example.com'), "new_list test");
15 dpavlin 31
16 dpavlin 36 ok($nos->_get_list('My list'), "_get_list");
17     ok($nos->_get_list('another'), "_get_list");
18     ok($nos->_get_list('test'), "_get_list");
19 dpavlin 29
20 dpavlin 36 my $i = 0;
21 dpavlin 32 foreach my $email (qw(foo@example.com bar@example.com baz@example.com)) {
22     ok($nos->add_member_to_list( list => 'My list', email => $email ), "add_member_to_list $email");
23 dpavlin 36 ok($nos->add_member_to_list( list => 'another', email => $email ), "add_member_to_list $email") if ($i % 2 == 0);
24     ok($nos->add_member_to_list( list => 'test', email => $email ), "add_member_to_list $email") if ($i % 3 == 0);
25 dpavlin 32 }
26    
27 dpavlin 36 ok($nos->add_message_to_list( list => 'My list', message => "Subject: test\n\nJust a test\n\n" ), "add_message_to_list");
28 dpavlin 32
29     foreach my $i ( 1 .. 10 ) {
30 dpavlin 36 ok($nos->add_message_to_list( list => 'another', message => "Subject: test $i" ), "add_message_to_list");
31 dpavlin 32 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26