3 # Wherein we ensure that postamble works ok.
6 if( $ENV{PERL_CORE} ) {
8 @INC = ('../lib', 'lib');
11 unshift @INC, 't/lib';
16 use Test::More tests => 8;
17 use MakeMaker::Test::Utils;
18 use MakeMaker::Test::Setup::BFD;
19 use ExtUtils::MakeMaker;
26 my $Makefile = makefile_name;
28 ok( setup_recurs(), 'setup' );
30 ok( chdir File::Spec->updir );
31 ok( teardown_recurs(), 'teardown' );
34 ok( chdir 'Big-Dummy', q{chdir'd to Big-Dummy} ) ||
35 diag("chdir failed: $!");
39 local $SIG{__WARN__} = sub {
40 $warnings = join '', @_;
43 my $stdout = tie *STDOUT, 'TieOut' or die;
44 my $mm = WriteMakefile(
46 VERSION_FROM => 'lib/Big/Dummy.pm',
52 is( $warnings, '', 'postamble argument not warned about' );
56 my($self, %extra) = @_;
58 is_deeply( \%extra, { FOO => 1, BAR => 'fugawazads' },
59 'postamble args passed' );
62 # This makes sure the postamble gets written
68 ok( open(MAKEFILE, $Makefile) ) or diag "Can't open $Makefile: $!";
70 like( <MAKEFILE>, qr/^\# This makes sure the postamble gets written\n/m,
71 'postamble added to the Makefile' );