Release commit for 5.90128
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_script_help.t
CommitLineData
4f0612fd 1use strict;
2use warnings;
3use Test::More;
2a56ace9 4use Test::Fatal;
4f0612fd 5
6use FindBin qw/$Bin/;
7use lib "$Bin/../lib";
8
1b9bb641 9no warnings 'once';
10*CORE::GLOBAL::exit = sub {};
11
4f0612fd 12{
13 package TestHelpScript;
14 use Moose;
15 with 'Catalyst::ScriptRole';
16 our $help;
8ba29999 17 sub print_usage_text { $help++ }
4f0612fd 18}
fb533ac3 19
fb533ac3 20test('--help');
3a8c155f 21test('-?');
fb533ac3 22
23sub test {
4f0612fd 24 local $TestHelpScript::help;
fb533ac3 25 local @ARGV = (@_);
2a56ace9 26 is exception {
fb533ac3 27 TestHelpScript->new_with_options(application_name => 'TestAppToTestScripts')->run;
2a56ace9 28 }, undef, 'Lives';
3a8c155f 29 ok $TestHelpScript::help, 'Got help';
4f0612fd 30}
31
32done_testing;