2 # https://rt.cpan.org/Public/Bug/Display.html?id=47865
3 # https://rt.cpan.org/Public/Bug/Display.html?id=52474
4 # https://rt.cpan.org/Public/Bug/Display.html?id=57683
5 # http://www.nntp.perl.org/group/perl.moose/2010/06/msg1767.html
7 # Summary: If we disable the "auto_help" option in Getopt::Long, then
8 # getoptions() will not call into pod2usage() (causing program termination)
9 # when --help is passed (and MooseX::ConfigFromFile is in use).
15 plan skip_all => 'This test needs MooseX::SimpleConfig 0.07'
16 unless eval { require MooseX::SimpleConfig && MooseX::SimpleConfig->VERSION(0.07); };
21 use strict; use warnings;
25 'MooseX::SimpleConfig',
28 # this is a hacky way of being able to check that we made it past the
29 # $opt_parser->getoptions() call in new_with_options, because it is
30 # still going to bail out later on, on seeing the --help flag
32 is => 'ro', isa => 'Str',
35 'this_value_unimportant',
47 ok(!$fail_on_exit, 'getoptions() lives');
51 # cancel the non-zero exit status from _getopt_full_usage()
59 throws_ok { Class->new_with_options }
60 #usage: 107_no_auto_help.t [-?] [long options...]
61 qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\t--configfile\s*.\t\Q-? --usage --help Prints this usage information.\E/ms,
62 'usage information looks good';
64 qr/^Specified configfile \'this_value_unimportant\' does not exist, is empty, or is not readable$/,
65 'Our dummy config file doesn\'t exist';