diff options
Diffstat (limited to 'ext/ExtUtils-MakeMaker/t/WriteEmptyMakefile.t')
-rw-r--r-- | ext/ExtUtils-MakeMaker/t/WriteEmptyMakefile.t | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/ExtUtils-MakeMaker/t/WriteEmptyMakefile.t b/ext/ExtUtils-MakeMaker/t/WriteEmptyMakefile.t new file mode 100644 index 0000000000..88496756c2 --- /dev/null +++ b/ext/ExtUtils-MakeMaker/t/WriteEmptyMakefile.t @@ -0,0 +1,34 @@ +#!/usr/bin/perl -w + +# This is a test of WriteEmptyMakefile. + +BEGIN { + unshift @INC, 't/lib'; +} + +chdir 't'; + +use strict; +use Test::More tests => 5; + +use ExtUtils::MakeMaker qw(WriteEmptyMakefile); +use TieOut; + +can_ok __PACKAGE__, 'WriteEmptyMakefile'; + +eval { WriteEmptyMakefile("something"); }; +like $@, qr/Need an even number of args/; + + +{ + ok( my $stdout = tie *STDOUT, 'TieOut' ); + + ok !-e 'wibble'; + END { 1 while unlink 'wibble' } + + WriteEmptyMakefile( + NAME => "Foo", + FIRST_MAKEFILE => "wibble", + ); + ok -e 'wibble'; +} |