Skip to content

Commit

Permalink
Item8640: Change from make_path and remove_tree to mkpath and rmtree …
Browse files Browse the repository at this point in the history
…- "Legacy interface to File::Path"

git-svn-id: http://svn.foswiki.org/trunk@6624 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Mar 3, 2010
1 parent 5f16ade commit db19702
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions UnitTestContrib/test/unit/ConfigureTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -394,21 +394,18 @@ sub test_Util_mapTarget {
$results = Foswiki::Configure::Util::mapTarget("/var/www/foswiki/", "$file");
$this->assert_str_equals( '/var/www/foswiki/stuff/testrun', $results );

#NotifyTopicName HomeTopicName WebPrefsTopicName
# MimeTypesFileName

}

sub test_Util_listDir {
my $this = shift;
use File::Path qw(make_path remove_tree);
use File::Path qw(mkpath rmtree);

my $tempdir = $Foswiki::cfg{TempfileDir} . '/test_Util_ListDir';
remove_tree($tempdir); # Cleanup any old tests
rmtree($tempdir); # Cleanup any old tests

make_path($tempdir);
make_path($tempdir."/asdf");
make_path($tempdir."/asdf/qwerty");
mkpath($tempdir);
mkpath($tempdir."/asdf");
mkpath($tempdir."/asdf/qwerty");

open ( FILE, ">$tempdir/asdf/qwerty/test.txt");
print FILE "asdfasdf \n";
Expand Down Expand Up @@ -447,7 +444,7 @@ sub test_Util_listDir {
$this->assert_str_equals( "WARNING: skipping possibly unsafe file (not able to show it for the same reason :( )<br />\n", $stdout );
$this->assert_num_equals( 3, $count, "listDir returned incorrect number of directories");

remove_tree($tempdir);
rmtree($tempdir);

@dir = Foswiki::Configure::Util::listDir("$tempdir");
$count = @dir;
Expand Down

0 comments on commit db19702

Please sign in to comment.