Permalink
Browse files

copy itself model in test area before re-writing it

  • Loading branch information...
dod38fr committed Apr 13, 2012
1 parent bb3bd08 commit b599158dbfbd56158aa0fe61b308350a0183abf2
Showing with 9 additions and 2 deletions.
  1. +9 −2 config-model-itself/t/load_write_itself.t
@@ -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/$_") ;
@@ -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
);

0 comments on commit b599158

Please sign in to comment.