diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-03-06 17:58:26 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-03-06 20:39:57 +0000 |
commit | 94af928955a63fcd4496a7acdd670b5237b2a3eb (patch) | |
tree | 10b1a44d6314997688477014b85ee74b718fe5e4 | |
parent | 79c67e3326f78c5970f69cc0b31a35619eb41e9a (diff) | |
download | perl-94af928955a63fcd4496a7acdd670b5237b2a3eb.tar.gz |
Ensure t/op/mkdir.t passes under minitest by loading File::Path in an eval.
File::Path::rmtree() is only used as a cleanup function of last resort - by
default t/op/mkdir.t directly cleans up the test directory that it creates
before it exits.
-rw-r--r-- | t/op/mkdir.t | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/t/op/mkdir.t b/t/op/mkdir.t index 0ad5dac4dc..ebbbd2e648 100644 --- a/t/op/mkdir.t +++ b/t/op/mkdir.t @@ -8,8 +8,15 @@ BEGIN { plan tests => 22; -use File::Path; -rmtree('blurfl'); +unless (eval { + require File::Path; + File::Path::rmtree('blurfl'); + 1 +}) { + diag("$0 may fail if its temporary directory remains from a previous run"); + diag("Attempted to load File::Path to delete directory t/blurfl - error was\n$@"); + diag("\nIf you have problems, please manually delete t/blurfl"); +} # tests 3 and 7 rather naughtily expect English error messages $ENV{'LC_ALL'} = 'C'; |