1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
use strict;
use warnings;
package basic;
use Test::More;
use File::Spec;
require_ok("Test::InDistDir");
can_ok( "Test::InDistDir", "import" );
chdir "t" if -d "t";
@INC = grep { !/\bblib\b/ and !/\blib\b/ } @INC;
my $script = ( File::Spec->splitpath( $0 ) )[-1];
ok( !-f "t/$script", "test script not visible" );
Test::InDistDir->import;
ok( -f "t/$script", "we moved up one directory, so test script is visible" );
ok( scalar( grep { /\blib\b/ } @INC ), "lib was added to INC" );
done_testing;
|