3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 76; |
use Test::More tests => 77; |
7 |
|
|
8 |
BEGIN { use_ok('Nos') }; |
BEGIN { use_ok('Nos') }; |
9 |
|
|
10 |
ok(my $nos = new Nos('dsn' => 'dbi:Pg:dbname=notices'), "new"); |
ok(my $nos = new Nos('dsn' => 'dbi:Pg:dbname=notices'), "new"); |
11 |
|
|
12 |
ok($nos->new_list( list => 'My list', email => 'my-list@example.com'), "new_list my-list"); |
my $aliases = './t/aliases'; |
13 |
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"); |
ok(! -e $aliases or unlink $aliases, "$aliases doesn't exist"); |
15 |
|
|
16 |
|
ok($nos->new_list( list => 'My list', email => 'my-list@example.com', aliases => $aliases), "new_list my-list"); |
17 |
|
ok($nos->new_list( list => 'another', email => 'another@example.com', aliases => $aliases), "new_list another"); |
18 |
|
ok($nos->new_list( list => 'test', email => 'test@example.com', aliases => $aliases), "new_list test"); |
19 |
|
|
20 |
ok($nos->_get_list('My list'), "_get_list"); |
ok($nos->_get_list('My list'), "_get_list"); |
21 |
ok($nos->_get_list('another'), "_get_list"); |
ok($nos->_get_list('another'), "_get_list"); |
66 |
|
|
67 |
# now test delete |
# now test delete |
68 |
|
|
69 |
ok($nos->new_list( list => 'delete', email => 'delete@example.com'), "new_list error"); |
ok($nos->new_list( list => 'delete', email => 'delete@example.com', aliases => $aliases), "new_list error"); |
70 |
|
|
71 |
ok($nos->add_member_to_list( list => 'delete', email => 'delete_me@example.com' ), "add test member"); |
ok($nos->add_member_to_list( list => 'delete', email => 'delete_me@example.com' ), "add test member"); |
72 |
|
|