no space identation
[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;
8a3a89c9 9use Cwd;
edff3fdc 10
11BEGIN { use_ok "App::FatPacker", "" }
12
13my $tempdir = File::Temp->newdir;
14mkpath([<$tempdir/{lib,fatlib}/t/mod>]);
15
16for(<t/mod/*.pm>) {
17 copy $_, "$tempdir/lib/$_" or die "copy failed: $!";
18}
19
8a3a89c9 20my $cwd = getcwd;
edff3fdc 21chdir $tempdir;
22
23my $fp = App::FatPacker->new;
24my $temp_fh = File::Temp->new;
25select $temp_fh;
26$fp->script_command_file;
27print "1;\n";
28select STDOUT;
29close $temp_fh;
30
31# Packed, now try using it:
32require $temp_fh;
33
34{
35 require t::mod::a;
36 no warnings 'once';
37 ok $t::mod::a::foo eq 'bar';
38}
8a3a89c9 39
40# moving away from the dir so it could be deleted
41chdir $cwd;