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