[siesta-commit] siesta/t 07list.t,1.19,1.20 07user.t,1.6,1.7

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

From: clampr
Subject: [siesta-commit] siesta/t 07list.t,1.19,1.20 07user.t,1.6,1.7
Date: 20:08 on 10 Sep 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv32758/t

Modified Files:
	07list.t 07user.t 
Log Message:
have ->new_from_hash take a hash not a hashref

Index: 07list.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/07list.t,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- 07list.t	5 Sep 2002 16:12:24 -0000	1.19
+++ 07list.t	10 Sep 2002 19:08:16 -0000	1.20
@@ -53,11 +53,10 @@
 
 
 # test instantiating from hash
-my $test_list = Siesta::List->new_from_hash ( {
-					id    => 'testing',
-					owner => 'test@xxxxxxx.xxx',
-				});
-
+my $test_list = Siesta::List->new_from_hash(
+                                            id    => 'testing',
+                                            owner => 'test@xxxxxxx.xxx',
+                                           );
 
 ok ($test_list, "list created from hash");
 isa_ok ($test_list, "Siesta::List");
@@ -79,10 +78,10 @@
 is($test_list, undef);
 
 # now try all those again with class methods
-my $again = Siesta::List->new_from_hash ( {
+my $again = Siesta::List->new_from_hash(
                                         id    => 'testing',
                                         owner => 'test@xxxxxxx.xxx',
-                                });
+                                        );
 
 ok($again);
 isa_ok($again, "Siesta::List");
@@ -96,7 +95,7 @@
 
 # make sure that we insert when there's nothing there
 # before and update when there is
-my $us = Siesta::List->new_from_hash( { id=>'caitlin' });
+my $us = Siesta::List->new_from_hash( id => 'caitlin' );
 ok($us->save(), "saved 'caitlin'");
 $flag = 0;
 foreach my $list (Siesta->storage->get_lists())

Index: 07user.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/07user.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- 07user.t	5 Sep 2002 16:12:24 -0000	1.6
+++ 07user.t	10 Sep 2002 19:08:17 -0000	1.7
@@ -12,7 +12,7 @@
 isa_ok( $user, "Siesta::User", );
 
 # test new from hash
-my $other = Siesta::User->new_from_hash( { id=>'bluntman@xxxxxxx.xxx', forename=>'bluntman', surname=>'chronic' });
+my $other = Siesta::User->new_from_hash( id=>'bluntman@xxxxxxx.xxx', forename=>'bluntman', surname=>'chronic' );
 ok( $other, "user created from hash");
 isa_ok ( $other, "Siesta::User");
 
@@ -37,9 +37,9 @@
 
 
 # now try all these as User class methods
-my $again = Siesta::User->new_from_hash( { id=>'chronic@xxxxxxx.xxx', 
-					   forename=>'charles', 
-					   surname=>'hronic' });
+my $again = Siesta::User->new_from_hash( id=>'chronic@xxxxxxx.xxx', 
+                                           forename=>'charles', 
+                                           surname=>'hronic' );
 ok ($again);
 isa_ok ($again, 'Siesta::User');
 ok ($again->save);
@@ -53,12 +53,12 @@
 
 # make sure that we insert when there's nothing there 
 # before and update when there is
-my $us = Siesta::User->new_from_hash( { id=>'test@test' });
+my $us = Siesta::User->new_from_hash( id=>'test@test' );
 ok($us->save(), "saved 'test\@test'");
 my $flag = 0;
 foreach my $user (Siesta->storage->get_users())
 {
-	$flag++ if ($user->id() eq 'test@test');
+        $flag++ if ($user->id() eq 'test@test');
 }
 is ($flag, 1, "inserted");
 ok($us->forename('test'));
@@ -66,7 +66,7 @@
 $flag = 0;
 foreach my $user (Siesta->storage->get_users())
 {
-	$flag++ if ($user->id() eq 'test@test');
+        $flag++ if ($user->id() eq 'test@test');
 }
 
 



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