Upgrade to Module::Build 0.2808_01
[p5sagit/p5-mst-13.2.git] / lib / Module / Build / t / runthrough.t
index a1756dd..3fa09d5 100644 (file)
@@ -12,22 +12,19 @@ my $have_yaml = Module::Build::ConfigData->feature('YAML_support');
 
 use Cwd ();
 my $cwd = Cwd::cwd;
-my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' );
+my $tmp = MBTest->tmpdir;
 
 use DistGen;
 my $dist = DistGen->new( dir => $tmp );
 $dist->remove_file( 't/basic.t' );
-$dist->change_file( 'Build.PL', <<'---' );
-use Module::Build;
-
-my $build = new Module::Build(
+$dist->change_build_pl
+({
   module_name => 'Simple',
   scripts     => [ 'script' ],
   license     => 'perl',
   requires    => { 'File::Spec' => 0 },
-);
-$build->create_build_script;
----
+});
+
 $dist->add_file( 'script', <<'---' );
 #!perl -w
 print "Hello, World!\n";
@@ -171,11 +168,11 @@ SKIP: {
   my $blib_script = File::Spec->catfile( qw( blib script script ) );
   ok -e $blib_script;
   
-  SKIP: {
+ SKIP: {
     skip("We do not rewrite shebang on VMS", 1) if $^O eq 'VMS';
-  my $fh = IO::File->new($blib_script);
-  my $first_line = <$fh>;
-  isnt $first_line, "#!perl -w\n", "should rewrite the shebang line";
+    my $fh = IO::File->new($blib_script);
+    my $first_line = <$fh>;
+    isnt $first_line, "#!perl -w\n", "should rewrite the shebang line";
   }
 }
 
@@ -221,15 +218,12 @@ echo Hello, World!
 ---
 
   $dist = DistGen->new( dir => $tmp );
-  $dist->change_file( 'Build.PL', <<'---' );
-use Module::Build;
-my $build = new Module::Build(
-  module_name => 'Simple',
-  scripts     => [ 'bin/script.bat' ],
-  license     => 'perl',
-);
-$build->create_build_script;
----
+  $dist->change_build_pl({
+                         module_name => 'Simple',
+                         scripts     => [ 'bin/script.bat' ],
+                         license     => 'perl',
+                        });
+
   $dist->add_file( 'bin/script.bat', $script_data );
 
   $dist->regen;