Since the module checks parent directories for some files/directories to
detect if it should run in dev mode, run the tests from an isolated
subdirectory. This ensures nothing in the temp directory or something
above it can interfere.
plan skip_all => 'Extra tests disabled on perls <= 5.008003' unless "$]" >= 5.008_004;
use File::Temp;
+use File::Spec;
+use File::Path qw(mkpath rmtree);
use Cwd 'cwd';
my %extras;
for my $version ( 1, 2 ) {
my $tempdir = File::Temp::tempdir('strictures-XXXXXX', CLEANUP => 1, TMPDIR => 1);
- chdir $tempdir;
+ my $subtemp = File::Spec->catdir($tempdir, 'sub1', 'sub2');
+ mkpath $subtemp;
+ chdir $subtemp;
local $strictures::Smells_Like_VCS = undef;
eval qq{
}
chdir $cwd;
- rmdir $tempdir;
+ rmtree $tempdir;
local $strictures::Smells_Like_VCS = 1;