document ::Trace thoroughly
[p5sagit/App-FatPacker.git] / t / pack.t
CommitLineData
edff3fdc 1#!perl
2use strict;
3use warnings FATAL => 'all';
4use Test::More qw(no_plan);
5use File::Basename;
6use File::Copy;
7use File::Path;
8use File::Temp;
9
10BEGIN { use_ok "App::FatPacker", "" }
11
12my $tempdir = File::Temp->newdir;
13mkpath([<$tempdir/{lib,fatlib}/t/mod>]);
14
15for(<t/mod/*.pm>) {
16 copy $_, "$tempdir/lib/$_" or die "copy failed: $!";
17}
18
19chdir $tempdir;
20
21my $fp = App::FatPacker->new;
22my $temp_fh = File::Temp->new;
23select $temp_fh;
24$fp->script_command_file;
25print "1;\n";
26select STDOUT;
27close $temp_fh;
28
29# Packed, now try using it:
30require $temp_fh;
31
32{
33 require t::mod::a;
34 no warnings 'once';
35 ok $t::mod::a::foo eq 'bar';
36}