[siesta-commit] siesta/t 07list.t,1.10,1.11

[prev] [thread] [next] [lurker] [Date index for 2002/08/23]

From: clampr
Subject: [siesta-commit] siesta/t 07list.t,1.10,1.11
Date: 12:11 on 23 Aug 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv15388

Modified Files:
	07list.t 
Log Message:
describe the tests, add more corner cases


Index: 07list.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/07list.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- 07list.t	23 Aug 2002 10:13:54 -0000	1.10
+++ 07list.t	23 Aug 2002 11:11:21 -0000	1.11
@@ -1,6 +1,6 @@
 #!perl -w
 use strict;
-use Test::More tests => 17;
+use Test::More tests => 20;
 use Test::MockObject;
 use Siesta::Config;
 BEGIN { $Siesta::Config::DBFILE = 't/test.db' }
@@ -14,8 +14,8 @@
 is( $list->post_address, 'dealers@xxxxxxxx.xxxxxxxxxx' );
 is( $list->return_path,  'dealers-bounce@xxxxxxxx.xxxxxxxxxx' );
 ok( $list->is_member('jay@xxxxxxxx.xxxxxxxxxx'), "jay is a member" );
-ok( !($list->is_member('brodie@comic-store')),
-    'brodie@ is subscribed as bob@' );
+ok( !($list->is_member('brodie@comic-store')),   "brodie isn't on any lists" );
+ok( !($list->is_member('dante@quick-stop')),     "dante isn't on this list" );
 
 my $user1 = Test::MockObject->new
   ->mock( id  => sub { 'jay@xxxxxxxx.xxxxxxxxxx' } );
@@ -27,13 +27,17 @@
 is (scalar($list->members()), 2, "only two members");
 my $flag = 1;
 foreach my $member ($list->members()) {
-  $flag = $flag && $list->is_member($member);
+    $flag = $flag && $list->is_member($member);
 }
 ok($flag, "->is_member agrees with ->members");
 
+# removal tests
 my $old_cnt = scalar($list->members());
-ok ($list->is_member('bob@xxxxxxxx.xxxxxxxxxx'));
-ok ($list->remove_member('bob@xxxxxxxx.xxxxxxxxxx'));
-ok (scalar($list->members()) == $old_cnt - 1);
-ok (!($list->is_member('bob@xxxxxxxx.xxxxxxxxxx')));
-ok ($list->is_member('jay@xxxxxxxx.xxxxxxxxxx'));
+ok( $list->is_member('bob@xxxxxxxx.xxxxxxxxxx'), "unsub - bob is a member" );
+ok( $list->remove_member('bob@xxxxxxxx.xxxxxxxxxx'), "remove successful" );
+ok( !$list->remove_member('dante@quick-stop'),   "remove of non-member" );
+ok( !$list->remove_member('brodie@comic-store'), "remove of a system nobody" );
+is(scalar($list->members()),  $old_cnt - 1, "members count went down");
+ok (!($list->is_member('bob@xxxxxxxx.xxxxxxxxxx')), "bob no longer a member");
+ok ($list->is_member('jay@xxxxxxxx.xxxxxxxxxx'), "jay still is");
+



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52