ExtUtils::MakeMaker 6.55_02
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / WriteEmptyMakefile.t
1 #!/usr/bin/perl -w
2
3 # This is a test of WriteEmptyMakefile.
4
5 BEGIN {
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
15 chdir 't';
16
17 use strict;
18 use Test::More tests => 5;
19
20 use ExtUtils::MakeMaker qw(WriteEmptyMakefile);
21 use TieOut;
22
23 can_ok __PACKAGE__, 'WriteEmptyMakefile';
24
25 eval { WriteEmptyMakefile("something"); };
26 like $@, 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 }