[prev] [thread] [next] [lurker] [Date index for 2002/09/02]
Update of /cvsroot/siesta/siesta/t In directory usw-pr-cvs1:/tmp/cvs-serv30270/t Modified Files: 08config.t Log Message: Config testing Index: 08config.t =================================================================== RCS file: /cvsroot/siesta/siesta/t/08config.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- 08config.t 2 Sep 2002 07:12:51 -0000 1.1 +++ 08config.t 2 Sep 2002 12:00:09 -0000 1.2 @@ -1,9 +1,10 @@ #!perl -w use strict; -use Test::More tests => 5; +use Test::More tests => 16; use Test::MockObject; use Siesta; use Siesta::Config::User; +use Siesta::Config::List; my $user_config = new Siesta::Config::User(); @@ -11,7 +12,30 @@ isa_ok($user_config, 'Siesta::Config'); +ok(!$user_config->get('foo','bar','key'), "key 'key' not defined for namespace 'bar' for user 'foo'"); +is($user_config->get('foo','bar','a'), 'b', "key 'a' is value 'b' in namespace 'bar' for user 'foo'"); +ok($user_config->set('foo','bar','key', 'value'), "key 'key' set as 'value' for namespace 'bar' for user 'foo'"); +is($user_config->get('foo','bar','key'), 'value', "key 'key' is value 'value' in namespace 'bar' for 'foo'"); +ok($user_config->set('foo','bar','key', 'new value'), "key 'key' set as 'new value' for namespace 'bar' for user 'foo'"); +is($user_config->get('foo','bar','key'), 'new value', "key 'key' is value 'new value' in namespace 'bar' for user 'foo'"); + + + +my $user_config = new Siesta::Config::List(); +ok($user_config, "per list config created"); + +isa_ok($user_config, 'Siesta::Config'); + ok(!$user_config->get('foo','bar','key'), "key 'key' not defined for namespace 'bar' in list 'foo'"); +is($user_config->get('foo','bar','a'), 'b', "key 'a' is value 'b' in namespace 'bar' in list 'foo'"); ok($user_config->set('foo','bar','key', 'value'), "key 'key' set as 'value' for namespace 'bar' in list 'foo'"); is($user_config->get('foo','bar','key'), 'value', "key 'key' is value 'value' in namespace 'bar' in list 'foo'"); +ok($user_config->set('foo','bar','key', 'new value'), "key 'key' set as 'new value' for namespace 'bar' in list 'foo'"); +is($user_config->get('foo','bar','key'), 'new value', "key 'key' is value 'new value' in namespace 'bar' in list 'foo'"); + +# no per user, per list one done just yet + + + +
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52