#!/usr/bin/perl
BEGIN {
$| = 1;
$^W = 1;
}
BEGIN { File::Remove::remove( \1,
'temp'
)
if
-e
'temp'
; }
END { File::Remove::remove( \1,
'temp'
)
if
-e
'temp'
; }
ok(
mkdir
(
'temp'
),
"Test directory 'temp' created"
);
my
$shell
= JSAN::Shell->new(
configdir
=>
'temp'
);
ok(!
$shell
->prefix,
"Initial prefix is empty"
);
is_deeply(
$shell
->read_config(), {},
"Initial 'read_config' returns empty hash"
);
$shell
->prefix(
'temp'
);
ok(
$shell
->prefix eq
'temp'
,
"Prefix was set"
);
$shell
->remember_config_option(
'prefix'
,
'temp'
);
is_deeply(
$shell
->read_config(), {
prefix
=>
'temp'
},
"Config file was updated"
);