include the expected location in the test name, for diagnosing mysterious failures
[p5sagit/local-lib.git] / t / install.t
index 8c6727c..100834f 100644 (file)
@@ -11,7 +11,7 @@ use Config;
 
 plan tests => 2;
 
-my $dir = tempdir(DIR => Cwd::abs_path('t'), CLEANUP => 1);
+my $dir = tempdir('test_local_lib-XXXXX', DIR => Cwd::abs_path('t'), CLEANUP => 1);
 
 use local::lib ();
 local::lib->import($dir);
@@ -20,7 +20,7 @@ my $orig_dir = cwd;
 SKIP: for my $dist_type (qw(EUMM MB)) {
   chdir File::Spec->catdir($orig_dir, qw(t dist), $dist_type);
   if ($dist_type eq 'EUMM') {
-    my ($stdout, $stderr) = capture { eval { 
+    my ($stdout, $stderr) = capture { eval {
       system($^X, 'Makefile.PL') && die "Makefile.PL failed";
       system($Config{make}, 'install') && die "$Config{make} install failed";
     } };
@@ -32,10 +32,9 @@ SKIP: for my $dist_type (qw(EUMM MB)) {
     } };
     diag $stdout, $stderr if $@;
   }
+  my $file = File::Spec->catfile($dir, qw(lib perl5), "$dist_type.pm");
   ok(
-    -e File::Spec->catfile(
-      $dir, qw(lib perl5), "$dist_type.pm",
-    ),
-    "$dist_type.pm installed into the correct location",
+    -e $file,
+    "$dist_type.pm installed as $file",
   );
 }