Upgrade to ExtUtils::MakeMaker 6.52
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / WriteEmptyMakefile.t
CommitLineData
277189c8 1#!/usr/bin/perl -w
2
3# This is a test of WriteEmptyMakefile.
4
5BEGIN {
6 if( $ENV{PERL_CORE} ) {
7 chdir 't' if -d 't';
8 @INC = ('../lib', 'lib');
9 }
10 else {
11 unshift @INC, 't/lib';
12 }
13}
14
15chdir 't';
16
17use strict;
c8d65f10 18use Test::More tests => 5;
277189c8 19
20use ExtUtils::MakeMaker qw(WriteEmptyMakefile);
21use TieOut;
22
23can_ok __PACKAGE__, 'WriteEmptyMakefile';
24
25eval { WriteEmptyMakefile("something"); };
26like $@, qr/Need an even number of args/;
27
28
29{
30 ok( my $stdout = tie *STDOUT, 'TieOut' );
31
32 ok !-e 'wibble';
33 END { 1 while unlink 'wibble' }
34
35 WriteEmptyMakefile(
36 NAME => "Foo",
37 FIRST_MAKEFILE => "wibble",
38 );
39 ok -e 'wibble';
40}