From: Sawyer X Date: Thu, 23 Feb 2012 18:07:27 +0000 (+0200) Subject: keep tempdir if FATPACKER_KEEP_TESTDIR env exists, use tempdir function for this X-Git-Tag: v0.9.7~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=550443095a242af5c5ead35aaa7c7528d716aaf7;p=p5sagit%2FApp-FatPacker.git keep tempdir if FATPACKER_KEEP_TESTDIR env exists, use tempdir function for this --- diff --git a/t/pack.t b/t/pack.t index b08e6fc..023dc00 100644 --- a/t/pack.t +++ b/t/pack.t @@ -5,12 +5,13 @@ use Test::More qw(no_plan); use File::Basename; use File::Copy; use File::Path; -use File::Temp; +use File::Temp qw/tempdir/; use Cwd; BEGIN { use_ok "App::FatPacker", "" } -my $tempdir = File::Temp->newdir; +my $keep = $ENV{'FATPACKER_KEEP_TESTDIR'}; +my $tempdir = tempdir($keep ? (CLEANUP => 0) : (CLEANUP => 1)); mkpath([<$tempdir/{lib,fatlib}/t/mod>]); for() { @@ -39,3 +40,4 @@ require $temp_fh; # moving away from the dir so it could be deleted chdir $cwd; +