From: Olivier Mengué Date: Sun, 1 May 2011 03:09:40 +0000 (+0200) Subject: Fix xt/subroutine-in-inc.t X-Git-Tag: 1.008008~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=366489a71a6d81aea324fc32b85ff58aad177b80;p=p5sagit%2Flocal-lib.git Fix xt/subroutine-in-inc.t --- diff --git a/xt/subroutine-in-inc.t b/xt/subroutine-in-inc.t index 9186a80..13b0c47 100644 --- a/xt/subroutine-in-inc.t +++ b/xt/subroutine-in-inc.t @@ -7,18 +7,21 @@ plan qw/no_plan/; use File::Spec; use Cwd; use File::Temp qw/ tempdir /; -my $dir = tempdir( DIR => Cwd::abs_path('t'), CLEANUP => 1 ); my $base; sub CODE_in_INC() { return scalar grep { ref eq 'CODE' } @INC; } +my $dir; + BEGIN { $base = CODE_in_INC; unshift @INC, sub { }; splice @INC, 3, 1, sub { }; push @INC, sub { }; + + $dir = tempdir( DIR => Cwd::abs_path('t'), CLEANUP => 1 ); } use local::lib( $dir );