1#!/usr/bin/perl -w 2 3use strict; 4use warnings; 5 6# This is a test of WriteEmptyMakefile. 7 8BEGIN { 9 unshift @INC, 't/lib'; 10} 11 12use File::Temp qw[tempdir]; 13my $tmpdir = tempdir( DIR => 't', CLEANUP => 1 ); 14use Cwd; my $cwd = getcwd; END { chdir $cwd } # so File::Temp can cleanup 15chdir $tmpdir; 16 17use strict; 18use Test::More tests => 5; 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} 41