Update Module::Load::Conditional to CPAN version 0.38
[p5sagit/p5-mst-13.2.git] / cpan / Module-Build / t / test_types.t
index 5f3f5cf..bcb58c4 100644 (file)
@@ -2,48 +2,44 @@
 
 use strict;
 use lib 't/lib';
-use MBTest tests => 15 + 12;
+use MBTest tests => 25;
 
-use_ok 'Module::Build';
-ensure_blib('Module::Build');
-
-my $tmp = MBTest->tmpdir;
+blib_load('Module::Build');
 
 use DistGen;
 
-my $dist = DistGen->new(dir => $tmp);
+my $dist = DistGen->new()->chdir_in;
 
 $dist->add_file('t/special_ext.st', <<'---');
-#!perl 
+#!perl
 use Test::More tests => 2;
 ok(1, 'first test in special_ext');
 ok(1, 'second test in special_ext');
 ---
 
 $dist->add_file('t/another_ext.at', <<'---');
-#!perl 
+#!perl
 use Test::More tests => 2;
 ok(1, 'first test in another_ext');
 ok(1, 'second test in another_ext');
 ---
 $dist->add_file('t/foo.txt', <<'---');
-#!perl 
+#!perl
 use Test::More tests => 1;
 ok 0, "don't run this non-test file";
 die "don't run this non-test file";
 ---
 
 $dist->regen;
-$dist->chdir_in;
 #########################
 
 my $mb = Module::Build->subclass(
    code => q#
-        sub ACTION_testspecial { 
+        sub ACTION_testspecial {
             shift->generic_test(type => 'special');
         }
 
-        sub ACTION_testanother { 
+        sub ACTION_testanother {
             shift->generic_test(type => 'another');
         }
   #
@@ -98,12 +94,12 @@ is(scalar(@{[$all_output =~ m/OK 1/mg]}), 3 );
 is(scalar(@{[$all_output =~ m/OK/mg]}),   8 );
 is(scalar(@{[$all_output =~ m/ALL TESTS SUCCESSFUL\./mg]}),   1);
 
-$dist->remove;
-
 { # once-again
 
+$dist->revert;
+
 $dist->add_file('t/foo/special.st', <<'---');
-#!perl 
+#!perl
 use Test::More tests => 2;
 ok(1, 'first test in special_ext');
 ok(1, 'second test in special_ext');
@@ -114,15 +110,14 @@ use strict; use Simple;
 ok 1;
 ---
 $dist->regen;
-$dist->chdir_in;
 
 my $mb = Module::Build->subclass(
    code => q#
-        sub ACTION_testspecial { 
+        sub ACTION_testspecial {
             shift->generic_test(type => 'special');
         }
 
-        sub ACTION_testanother { 
+        sub ACTION_testanother {
             shift->generic_test(type => 'another');
         }
   #
@@ -174,7 +169,6 @@ like($all_output, qr/^OK 2 - SECOND TEST IN ANOTHER_EXT/m);
 is(scalar(@{[$all_output =~ m/(OK 1)/mg]}), 5 );
 is(scalar(@{[$all_output =~ m/(OK)/mg]}),   13 );
 
-$dist->remove;
 } # end once-again
 
 # vim:ts=4:sw=4:et:sta