X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fpack.t;fp=t%2Fpack.t;h=55e510448a3b7ae587d5aca85a3c417b70037da2;hb=e43a039789413887ab1c472762db2f6e576f7fac;hp=16bc91af3197d917122b9dd337bc9d582b55dc5e;hpb=f93cfa2d48dd7db7e164e29fdded3d595142921d;p=p5sagit%2FApp-FatPacker.git diff --git a/t/pack.t b/t/pack.t index 16bc91a..55e5104 100644 --- a/t/pack.t +++ b/t/pack.t @@ -11,18 +11,22 @@ use Cwd; use App::FatPacker; my $keep = $ENV{'FATPACKER_KEEP_TESTDIR'}; -my $tempdir = tempdir($keep ? (CLEANUP => 0) : (CLEANUP => 1)); + +my $cwd = getcwd; +my $tempdir = tempdir('fatpacker-XXXXX', DIR => "$cwd/t", $keep ? (CLEANUP => 0) : (CLEANUP => 1)); mkpath([<$tempdir/{lib,fatlib}/t/mod>]); for() { copy $_, "$tempdir/lib/$_" or die "copy failed: $!"; } -my $cwd = getcwd; chdir $tempdir; my $fp = App::FatPacker->new; -my $temp_fh = File::Temp->new; +my $packed_file = "$tempdir/script"; +open my $temp_fh, '>', $packed_file + or die "can't write to $packed_file: $!"; + select $temp_fh; $fp->script_command_file; print "1;\n"; @@ -33,7 +37,7 @@ close $temp_fh; chdir File::Spec->tmpdir; # Packed, now try using it: -require $temp_fh; +require $packed_file; { require t::mod::a;