Commit | Line | Data |
277189c8 |
1 | #!/usr/bin/perl -w |
2 | |
3 | # This is a test of WriteEmptyMakefile. |
4 | |
5 | BEGIN { |
b78fd716 |
6 | unshift @INC, 't/lib'; |
277189c8 |
7 | } |
8 | |
9 | chdir 't'; |
10 | |
11 | use strict; |
c8d65f10 |
12 | use Test::More tests => 5; |
277189c8 |
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 | } |