[prev] [thread] [next] [lurker] [Date index for 2002/08/23]
Update of /cvsroot/siesta/siesta/t In directory usw-pr-cvs1:/tmp/cvs-serv4992/t Modified Files: 10plugin_membersonly.t 10plugin_simplesig.t Log Message: change the Plugin->process api to simplify code Index: 10plugin_membersonly.t =================================================================== RCS file: /cvsroot/siesta/siesta/t/10plugin_membersonly.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- 10plugin_membersonly.t 21 Aug 2002 14:05:26 -0000 1.3 +++ 10plugin_membersonly.t 23 Aug 2002 14:26:38 -0000 1.4 @@ -11,19 +11,22 @@ my $message; my $plugin = Siesta::Plugin::MembersOnly->new; +my $list = Siesta::List->new( 'dealers' ); my $mail = Test::MockObject->new ->mock( from => sub { 'dante@quick-stop' } ) - ->mock( reply => sub { $message = join '', @_ } ); -my $list = Siesta::List->new( 'dealers' ); + ->mock( reply => sub { $message = join '', @_ } ) + ->mock( list => sub { $list } ); -ok( $plugin->process( mail => $mail, list => $list ), "rejected dante" ); +ok( $plugin->process( $mail ), "rejected dante" ); like( $message, qr{Non-member posting is disabled}, "said why" ); $mail->mock( from => sub { 'jack.black@holywood' } ); -ok( $plugin->process( mail => $mail, list => $list ), +ok( $plugin->process( $mail ), "jack.black isn't even on the system" ); $mail = Test::MockObject->new - ->mock( from => sub { 'jay@xxxxxxxx.xxxxxxxxxx' } ); -ok( !$plugin->process( mail => $mail, list => $list ), "accepted jay" ); + ->mock( from => sub { 'jay@xxxxxxxx.xxxxxxxxxx' } ) + ->mock( list => sub { $list } ); + +ok( !$plugin->process( $mail ), "accepted jay" ); Index: 10plugin_simplesig.t =================================================================== RCS file: /cvsroot/siesta/siesta/t/10plugin_simplesig.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- 10plugin_simplesig.t 21 Aug 2002 16:21:39 -0000 1.3 +++ 10plugin_simplesig.t 23 Aug 2002 14:26:38 -0000 1.4 @@ -22,13 +22,14 @@ my $reply; -my $mail = Test::MockObject->new - ->mock( body => sub { [ @mail ] } ) - ->mock( reply => sub { $reply = join '', @_ } ); my $list = Test::MockObject->new ->mock( owner => sub { "Daddy" } ); +my $mail = Test::MockObject->new + ->mock( body => sub { [ @mail ] } ) + ->mock( reply => sub { $reply = join '', @_ } ) + ->mock( list => sub { $list } ); my $plugin = new Siesta::Plugin::SimpleSig; -ok( $plugin->process(mail => $mail, list => $list), "reject super-long sig" ); +ok( $plugin->process( $mail ), "reject super-long sig" ); like( $reply, qr{Daddy has set this list to have a maximum .sig}, "explain why" );
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52