Upgrade to MakeMaker 6.53_02
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / pod2man.t
1 #!/usr/bin/perl -w
2
3 # Test our simulation of pod2man
4
5 use strict;
6 use lib 't/lib';
7
8 use ExtUtils::Command::MM;
9
10 use Test::More tests => 3;
11
12 # The argument to perm_rw was optional.
13 # [rt.cpan.org 35190]
14 {
15     my $warnings;
16     local $SIG{__WARN__} = sub {
17         $warnings .= join '', @_;
18     };
19
20     pod2man("--perm_rw");
21
22     like $warnings, qr/^Option perm_rw requires an argument/;
23 };
24
25
26 # Simulate the failure of Pod::Man loading.
27 # pod2man() should react gracefully.
28 {
29     local @INC = @INC;
30     unshift @INC, sub {
31         die "Simulated Pod::Man failure\n" if $_[1] eq 'Pod/Man.pm';
32     };
33     local %INC = %INC;
34     delete $INC{"Pod/Man.pm"};
35
36     my $warnings;
37     local $SIG{__WARN__} = sub {
38         $warnings .= join '', @_;
39     };
40
41     is pod2man(), undef;
42     is $warnings, <<'END'
43 Pod::Man is not available: Simulated Pod::Man failure
44 Man pages will not be generated during this install.
45 END
46
47 }