add option to reset @INC to defaults at top of fatpacked script
[p5sagit/App-FatPacker.git] / t / pack.t
index cbbcb71..2af80d0 100644 (file)
--- a/t/pack.t
+++ b/t/pack.t
@@ -25,7 +25,7 @@ chdir $tempdir;
 my $fp = App::FatPacker->new;
 my $temp_fh = File::Temp->new;
 select $temp_fh;
-$fp->script_command_file;
+$fp->script_command_file([qw/--core-only/]);
 print "1;\n";
 select STDOUT;
 close $temp_fh;
@@ -33,6 +33,9 @@ close $temp_fh;
 # make sure we don't pick up things from our created dir
 chdir File::Spec->tmpdir;
 
+my $guts = do { local (@ARGV,$/) = "$temp_fh"; <> };
+like( $guts, qr/\QBEGIN { use Config\E/, "saw core-only preamble" );
+
 # Packed, now try using it:
 require $temp_fh;
 
@@ -49,11 +52,12 @@ require $temp_fh;
 
     my @files = sort $INC[0]->files;
 
-    is_deeply( \@files, [ 't/mod/a.pm',
-                       't/mod/b.pm',
-                       't/mod/c.pm',
-                       't/mod/cond.pm',
-                       ], "\$INC[0]->files returned the files" );
+    is_deeply( \@files, [
+        't/mod/a.pm',
+        't/mod/b.pm',
+        't/mod/c.pm',
+        't/mod/cond.pm',
+    ], "\$INC[0]->files returned the files" );
 
 }