Remove unused Module::Build tests
[p5sagit/p5-mst-13.2.git] / lib / Module / Build / t / new_from_context.t
CommitLineData
7253302f 1#!/usr/bin/perl -w
2
3use strict;
4use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
5use MBTest tests => 2;
6
7use Cwd ();
8my $cwd = Cwd::cwd;
9my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' );
10
11use DistGen;
12my $dist = DistGen->new( dir => $tmp );
13
14my $libdir = 'badlib';
15$dist->add_file("$libdir/Build.PL", 'die');
16$dist->regen;
17
18chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!";
19
20use IO::File;
21use Module::Build;
22
23unshift(@INC, $libdir);
24my $mb = eval { Module::Build->new_from_context};
25ok(! $@, 'dodged the bullet') or die;
26ok($mb);
27
28# cleanup
29chdir( $cwd ) or die "Can''t chdir to '$cwd': $!";
30$dist->remove;
31
32use File::Path;
33rmtree( $tmp );
34
35# vim:ts=2:sw=2:et:sta