test warning on directory creation
[p5sagit/local-lib.git] / t / stackable.t
index c73d7f3..1922245 100644 (file)
@@ -10,6 +10,8 @@ use local::lib ();
 
 use lib 't/lib'; use TempDir;
 
+delete $ENV{PERL_LOCAL_LIB_ROOT};
+
 my $dir1 = mk_temp_dir('test_local_lib-XXXXX');
 my $dir2 = mk_temp_dir('test_local_lib-XXXXX');
 
@@ -17,7 +19,6 @@ my ($dir1_arch, $dir2_arch) = map { File::Spec->catfile($_, qw'lib perl5', $Conf
 note $dir1_arch;
 note $dir2_arch;
 
-
 my $prev_active = () = local::lib->active_paths;
 
 local::lib->import($dir1);
@@ -46,7 +47,7 @@ like $ENV{PERL_MM_OPT}, qr/\Q$dir2_escape/, 'second path is installation target'
 local::lib->import($dir1);
 my @active = local::lib->active_paths;
 is @active, $prev_active + 2, 'still two active dirs after re-adding first';
-is $active[-1], $dir1, 'first dir was re-added on top';
+is $active[0], $dir1, 'first dir was re-added on top';
 like $ENV{PERL_MM_OPT}, qr/\Q$dir1_escape/, 'first path is installation target again';
 
 local::lib->import('--deactivate', $dir2);