| 1 | #!./perl -w
|
|---|
| 2 |
|
|---|
| 3 | BEGIN {
|
|---|
| 4 | chdir 't';
|
|---|
| 5 | @INC = '../lib';
|
|---|
| 6 | @OrigINC = @INC;
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | use Test::More tests => 13;
|
|---|
| 10 | use Config;
|
|---|
| 11 | use File::Spec;
|
|---|
| 12 | use File::Path;
|
|---|
| 13 |
|
|---|
| 14 | #set up files and directories
|
|---|
| 15 | my @lib_dir;
|
|---|
| 16 | my $Lib_Dir;
|
|---|
| 17 | my $Arch_Dir;
|
|---|
| 18 | my $Auto_Dir;
|
|---|
| 19 | my $Module;
|
|---|
| 20 | BEGIN {
|
|---|
| 21 | # lib.pm is documented to only work with Unix filepaths.
|
|---|
| 22 | @lib_dir = qw(stuff moo);
|
|---|
| 23 | $Lib_Dir = join "/", @lib_dir;
|
|---|
| 24 | $Arch_Dir = join "/", @lib_dir, $Config{archname};
|
|---|
| 25 |
|
|---|
| 26 | # create the auto/ directory and a module
|
|---|
| 27 | $Auto_Dir = File::Spec->catdir(@lib_dir, $Config{archname},'auto');
|
|---|
| 28 | $Module = File::Spec->catfile(@lib_dir, 'Yup.pm');
|
|---|
| 29 |
|
|---|
| 30 | mkpath [$Auto_Dir];
|
|---|
| 31 |
|
|---|
| 32 | open(MOD, ">$Module") || DIE $!;
|
|---|
| 33 | print MOD <<'MODULE';
|
|---|
| 34 | package Yup;
|
|---|
| 35 | $Plan = 9;
|
|---|
| 36 | return '42';
|
|---|
| 37 | MODULE
|
|---|
| 38 |
|
|---|
|
|---|