[siesta-commit] siesta/t 08config.t,1.11,1.12 10plugin_subscribe.t,1.6,1.7

[prev] [thread] [next] [lurker] [Date index for 2002/09/20]

From: clampr
Subject: [siesta-commit] siesta/t 08config.t,1.11,1.12 10plugin_subscribe.t,1.6,1.7
Date: 21:32 on 20 Sep 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv24478/t

Modified Files:
	08config.t 10plugin_subscribe.t 
Log Message:
perltidy

Index: 08config.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/08config.t,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- 08config.t	20 Sep 2002 13:40:24 -0000	1.11
+++ 08config.t	20 Sep 2002 20:32:06 -0000	1.12
@@ -23,12 +23,11 @@
 is( $value, 0, "insert default" );
 
 # delete
-ok(Siesta->storage->delete_config('ReplyTo', undef, undef, 'munge'));
+ok( Siesta->storage->delete_config( 'ReplyTo', undef, undef, 'munge' ) );
 $value =
   Siesta->storage->get_config_explicitly( 'ReplyTo', undef, undef, 'munge' );
 is( $value, undef, "delete" );
 
-
 #############
 # per list
 #############
@@ -60,8 +59,6 @@
                                           undef, 'munge' );
 is( $value, 0, "insert per user" );
 
-
-
 #############
 # list/user
 #############
@@ -278,9 +275,9 @@
 is( $value, 0, "plugin check per user, per list" );
 
 # try delete
-ok($plugin->config($default, 'quux', 'mook'));
+ok( $plugin->config( $default, 'quux', 'mook' ) );
 $value = $plugin->config( $default, 'quux' );
-is( $value, 'mook');
-ok($plugin->delete_config($default, 'quux'));
+is( $value, 'mook' );
+ok( $plugin->delete_config( $default, 'quux' ) );
 $value = $plugin->config( $default, 'quux' );
-is( $value, undef)
+is( $value, undef )

Index: 10plugin_subscribe.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/10plugin_subscribe.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- 10plugin_subscribe.t	20 Sep 2002 13:29:39 -0000	1.6
+++ 10plugin_subscribe.t	20 Sep 2002 20:32:06 -0000	1.7
@@ -17,33 +17,28 @@
 
 my $list =
   Test::MockObject->new->mock( id => sub { 'escapees' } )
-  ->mock( owner      => sub { 'houdini@elsewhere' } )
+  ->mock( owner => sub { 'houdini@elsewhere' } )
   ->mock( add_member => sub { $_[1] eq 'suzanne@lab' || $_[1] eq 'foo@bar' } )
-  ->mock( members    => sub { return ($juser) } );
-
+  ->mock( members => sub { return ($juser) } );
 
 my $mail =
   Test::MockObject->new->mock( list => sub { $list } )
-  ->mock( from  => sub { 'suzanne@lab' } )
-  ->mock( user  => sub { $user } )
-  ->mock( subject => sub { shift; 
-			   my $nsubject = shift;
-			   $subject = $nsubject if (defined $nsubject); 
-			   return $subject;
-			 } )
-  ->mock( reply => sub { shift; $reply = {@_}->{body} } );
-
+  ->mock( from => sub { 'suzanne@lab' } )->mock( user => sub { $user } )->mock(
+    subject => sub {
+        shift;
+        my $nsubject = shift;
+        $subject = $nsubject if ( defined $nsubject );
+        return $subject;
+    }
+  )->mock( reply => sub { shift; $reply = {@_}->{body} } );
 
-$mail ->mock( clone => sub { $mail } );
-  
+$mail->mock( clone => sub { $mail } );
 
 # try an initial sub mail
 ok( $plugin->process($mail), "request handled" );
-like( $reply,
-      qr/You have requested to be subscribed to/,
+like( $reply, qr/You have requested to be subscribed to/,
       "challenged suzanne" );
 
-
 # now try again 
 $subject = "FOO BAR";
 ok( $plugin->process($mail), "request handled" );
@@ -51,36 +46,23 @@
       qr/You have requested to be subscribed to/,
       "not fooled by repeated requests" );
 
-
 # now try a fake subscriber key
-my $tmp   = $subject; # save the valid subscribers key
-$subject  = 'SUBSCRIBE foobar';      
+my $tmp = $subject;    # save the valid subscribers key
+$subject = 'SUBSCRIBE foobar';
 
 $plugin->process($mail);
-like( $reply,
-      qr/The subscribe key you gave was invalid/,
-      "invalid key" );
-
+like( $reply, qr/The subscribe key you gave was invalid/, "invalid key" );
 
 # try again with a valid key
 $subject = $tmp;
 $plugin->process($mail);
-like( $reply,
-      qr/You have been successfully subscribed to/,
-      "valid key" );
-
-
-
-
+like( $reply, qr/You have been successfully subscribed to/, "valid key" );
 
 # try faking with a previously valid key
 $mail->mock( from => sub { 'foo@bar' } );
 $plugin->process($mail);
 
-like( $reply,
-      qr/The subscribe key you gave was invalid/,
-      "none existent key" );
-
+like( $reply, qr/The subscribe key you gave was invalid/, "none existent key" );
 
 # try a previously subscribed user
 $user = $juser;
@@ -89,28 +71,20 @@
 $subject = 'Foo';
 
 $plugin->process($mail);
-like( $reply,
-      qr/Maybe you are already subscribed/,
-      "already subbed" );
+like( $reply, qr/Maybe you are already subscribed/, "already subbed" );
 
 # try an invalid user (only invalid cos we say it is)
 $mail->mock( from => sub { 'bob@jail' } );
 
 $subject = 'Bar';
 
-$user = Test::MockObject->new()->mock( id => sub { 'bob@jail' } ); 
+$user = Test::MockObject->new()->mock( id => sub { 'bob@jail' } );
 $plugin->process($mail);
-like($reply,
-	qr/You have requested to be subscribed to/,
-	"trying to sub bob");
+like( $reply, qr/You have requested to be subscribed to/, "trying to sub bob" );
 
 # send it right back at them
-ok($plugin->process($mail),"processed again");
-
-like( $reply,
-      qr/Maybe you are already subscribed/,
-      "force failure" );
-
+ok( $plugin->process($mail), "processed again" );
 
+like( $reply, qr/Maybe you are already subscribed/, "force failure" );
 
 1;



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