Skip to content

Commit

Permalink
copy itself model in test area before re-writing it
Browse files Browse the repository at this point in the history
  • Loading branch information
dod38fr committed Apr 13, 2012
1 parent bb3bd08 commit b599158
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions config-model-itself/t/load_write_itself.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mkdir($wr_test) ;

# copy test model
my $wanted = sub {
return if /svn|data$|~$/ ;
return if /data$|~$/ ;
s!data/!! ;
-d $File::Find::name && mkpath( ["$wr_test/$_"], 0, 0755) ;
-f $File::Find::name && copy($File::Find::name,"$wr_test/$_") ;
Expand All @@ -48,9 +48,16 @@ ok($inst,"Read Itself::Model and created instance") ;

my $root = $inst -> config_root ;

# copy itself model
my $model_dir = 'lib/Config/Model/models';
$wanted = sub {
-d $File::Find::name && mkpath( ["$wr_test/$_"], 0, 0755) ;
-f $File::Find::name && copy($File::Find::name,"$wr_test/$_") ;
};
find ({ wanted =>$wanted, no_chdir=>1} , $model_dir ) ;

my $rw_obj = Config::Model::Itself->new(
model_dir => $model_dir,
model_dir => "$wr_test/$model_dir",
model_object => $root
);

Expand Down

0 comments on commit b599158

Please sign in to comment.