This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add missing test boilerplates to new MakeMaker tests
[perl5.git] / lib / ExtUtils / t / pod2man.t
CommitLineData
5bdf71cc
RGS
1#!/usr/bin/perl -w
2
e39d7803
RGS
3BEGIN {
4 if ($ENV{PERL_CORE}) {
5 chdir 't' if -d 't';
6 @INC = qw(../lib);
7 }
8}
9
5bdf71cc
RGS
10# Test our simulation of pod2man
11
12use strict;
13use lib 't/lib';
14
15use ExtUtils::Command::MM;
16
17use Test::More tests => 3;
18
19# The argument to perm_rw was optional.
20# [rt.cpan.org 35190]
21{
22 my $warnings;
23 local $SIG{__WARN__} = sub {
24 $warnings .= join '', @_;
25 };
26
27 pod2man("--perm_rw");
28
29 like $warnings, qr/^Option perm_rw requires an argument/;
30};
31
32
33# Simulate the failure of Pod::Man loading.
34# pod2man() should react gracefully.
35{
36 local @INC = @INC;
37 unshift @INC, sub {
38 die "Simulated Pod::Man failure\n" if $_[1] eq 'Pod/Man.pm';
39 };
40 local %INC = %INC;
41 delete $INC{"Pod/Man.pm"};
42
43 my $warnings;
44 local $SIG{__WARN__} = sub {
45 $warnings .= join '', @_;
46 };
47
48 is pod2man(), undef;
49 is $warnings, <<'END'
50Pod::Man is not available: Simulated Pod::Man failure
51Man pages will not be generated during this install.
52END
53
54}