Upgrade to Module-Build-0.30
[p5sagit/p5-mst-13.2.git] / lib / Module / Build / t / install.t
index 42fafc5..317ca8b 100644 (file)
@@ -2,8 +2,12 @@
 
 use strict;
 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
-use MBTest tests => 34;
+use MBTest tests => 36;
 
+use_ok 'Module::Build';
+ensure_blib('Module::Build');
+
+use Config;
 use Cwd ();
 my $cwd = Cwd::cwd;
 my $tmp = MBTest->tmpdir;
@@ -11,14 +15,10 @@ my $tmp = MBTest->tmpdir;
 use DistGen;
 my $dist = DistGen->new( dir => $tmp );
 $dist->regen;
-
-chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!";
+$dist->chdir_in;
 
 #########################
 
-use Module::Build;
-use Config;
-
 
 $dist->add_file( 'script', <<'---' );
 #!perl -w
@@ -225,11 +225,10 @@ Simple Man <simple@example.com>
   is keys %$pms, 0;
 
   # revert to pristine state
-  chdir( $cwd ) or die "Can''t chdir to '$cwd': $!";
   $dist->remove;
   $dist = DistGen->new( dir => $tmp );
   $dist->regen;
-  chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!";
+  $dist->chdir_in;
 }
 
 sub strip_volume {
@@ -246,8 +245,4 @@ sub file_exists {
 
 
 # cleanup
-chdir( $cwd ) or die "Can''t chdir to '$cwd': $!";
 $dist->remove;
-
-use File::Path;
-rmtree( $tmp );