[siesta-commit] siesta/t 04config.t,NONE,1.1

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

From: muttley
Subject: [siesta-commit] siesta/t 04config.t,NONE,1.1
Date: 16:17 on 02 Sep 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv31542

Added Files:
	04config.t 
Log Message:
Testing config stuff.


--- NEW FILE: 04config.t ---
#!perl -w
use strict;
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('jay@xxxxxxxx.xxxxxxxxxx');
ok($user_config, "per user config created");

isa_ok($user_config, 'Siesta::Config');

ok(!$user_config->get('bar','key'), "key 'key' not defined for namespace 'bar' for user 'foo'");
is($user_config->get('bar','a'), 'b', "key 'a' is value 'b' in namespace 'bar' for user 'foo'");
ok($user_config->set('bar','key', 'value'), "key 'key' set as 'value' for namespace 'bar' for user 'foo'");
is($user_config->get('bar','key'), 'value', "key 'key' is value 'value' in namespace 'bar' for 'foo'");
ok($user_config->set('bar','key', 'new value'), "key 'key' updated to 'new value' for namespace 'bar' for user 'foo'");
is($user_config->get('bar','key'), 'new value', "key 'key' is value 'new value' in namespace 'bar' for user 'foo'");



my $list_config = new Siesta::Config::List('dealers');
ok($list_config, "per list config created");

isa_ok($list_config, 'Siesta::Config');

ok(!$list_config->get('bar','key'), "key 'key' not defined for namespace 'bar' in list 'foo'");
is($list_config->get('bar','a'), 'b', "key 'a' is value 'b' in namespace 'bar' in list 'foo'");
ok($list_config->set('bar','key', 'value'), "key 'key' set as 'value' for namespace 'bar' in list 'foo'");
is($list_config->get('bar','key'), 'value', "key 'key' is value 'value' in namespace 'bar' in list 'foo'");
ok($list_config->set('bar','key', 'new value'), "key 'key' updated to 'new value' for namespace 'bar' in list 'foo'");
is($list_config->get('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