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