[siesta-commit] siesta/t 07list.t,1.2,1.3

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

From: gmccarroll
Subject: [siesta-commit] siesta/t 07list.t,1.2,1.3
Date: 09:15 on 23 Aug 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv12891

Modified Files:
	07list.t 
Log Message:

another couple of is_member tests, this time using mock objects


Index: 07list.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/07list.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- 07list.t	23 Aug 2002 08:11:48 -0000	1.2
+++ 07list.t	23 Aug 2002 08:15:11 -0000	1.3
@@ -1,6 +1,7 @@
 #!perl -w
 use strict;
-use Test::More tests => 8;
+use Test::More tests => 10;
+use Test::MockObject;
 use Siesta::Config;
 BEGIN { $Siesta::Config::DBFILE = 't/test.db' }
 use Siesta::List;
@@ -14,3 +15,8 @@
 is( $list->return_path,  'dealers-bounce@xxxxxxxx.xxxxxxxxxx' );
 ok( $list->is_member('jay@xxxxxxxx.xxxxxxxxxx') );
 ok( !($list->is_member('silent_bob@xxxxxxxx.xxxxxxxxxx')) );
+my $user1 = Test::MockObject->new->mock( id  => sub { 'jay@xxxxxxxx.xxxxxxxxxx' } );
+ok( $list->is_member($user1) );
+my $user2 = Test::MockObject->new->mock( id  => sub { 'silent_bob@xxxxxxxx.xxxxxxxxxx' } );
+ok( !($list->is_member($user2)) );
+



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