[siesta-commit] siesta/t 04config.t,1.1,1.2 07list.t,1.15,1.16 07user.t,1.3,1.4

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

From: muttley
Subject: [siesta-commit] siesta/t 04config.t,1.1,1.2 07list.t,1.15,1.16 07user.t,1.3,1.4
Date: 13:39 on 05 Sep 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv14589/t

Modified Files:
	04config.t 07list.t 07user.t 
Log Message:
Update tests for new storage configuration


Index: 04config.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/04config.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- 04config.t	2 Sep 2002 15:17:01 -0000	1.1
+++ 04config.t	5 Sep 2002 12:39:07 -0000	1.2
@@ -7,6 +7,7 @@
 use Siesta::Config::List;
 
 
+Siesta->connect(DBI => 'dbi:SQLite:t/test.db');
 my $user_config = new Siesta::Config::User('jay@xxxxxxxx.xxxxxxxxxx');
 ok($user_config, "per user config created");
 

Index: 07list.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/07list.t,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- 07list.t	2 Sep 2002 15:16:08 -0000	1.15
+++ 07list.t	5 Sep 2002 12:39:07 -0000	1.16
@@ -4,12 +4,15 @@
 use Test::MockObject;
 use Siesta;
 use Siesta::List;
+use Data::Dumper;
 
 Siesta->connect( DBI=> "dbi:SQLite:t/test.db" );
 
 my $list = Siesta::List->new( 'dealers' );
-ok( $list, "list created" );
 isa_ok( $list, "Siesta::List", );
+ok( $list, "list created" );
+
+
 is( $list->id, "dealers" );
 is( $list->owner,        'jay@xxxxxxxx.xxxxxxxxxx' );
 is( $list->post_address, 'dealers@xxxxxxxx.xxxxxxxxxx' );

Index: 07user.t
===================================================================
RCS file: /cvsroot/siesta/siesta/t/07user.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- 07user.t	2 Sep 2002 15:16:09 -0000	1.3
+++ 07user.t	5 Sep 2002 12:39:07 -0000	1.4
@@ -1,6 +1,6 @@
 #!perl -w
 use strict;
-use Test::More tests => 5;
+use Test::More tests => 6;
 use Test::MockObject;
 use Siesta;
 use Siesta::User;
@@ -11,8 +11,19 @@
 ok( $user, "user created" );
 isa_ok( $user, "Siesta::User", );
 
+my $other = Siesta::User->new_from_hash( { id=>'bluntman@xxxxxxx.xxx', forename=>'bluntman', surname=>'chronic' });
+ok( $user, "user created from hash");
+isa_ok ( $user, "Siesta::User");
+
+Siesta->storage->save_user($other);
+
+$other = undef;
+
+$other = Siesta::User->new('bluntman@xxxxxxx.xxx');
+ok( $user, "user reloaded");
+isa_ok ( $other, "Siesta::User");
+is($other->forename(), 'bluntman', "correct data");
+
+
 # option
 # config
-is ($user->get_config('bar', 'a'), 'b', "getting the config");
-ok ($user->set_config('bar', 'a', 'whatever'), "setting new config");
-is ($user->get_config('bar', 'a'), 'whatever', "getting the new config");



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