Unified help display, at the cost of having lost the info about what you fucked up...
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_script_help.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use Test::More;
5
6 use FindBin qw/$Bin/;
7 use lib "$Bin/../lib";
8
9 {
10     package TestHelpScript;
11     use Moose;
12     with 'Catalyst::ScriptRole';
13     our $help;
14     sub _exit_with_usage { $help++ }
15 }
16 {
17     local $TestHelpScript::help;
18     local @ARGV = ('-h');
19     TestHelpFromScriptCGI->new_with_options(application_name => 'TestAppToTestScripts')->run;
20     ok $TestHelpFromScriptCGI::help, 1;
21 }
22 {
23     local $TestHelpScript::help;
24     local @ARGV = ('--help');
25     TestHelpFromScriptCGI->new_with_options(application_name => 'TestAppToTestScripts')->run;
26     is $TestHelpFromScriptCGI::help, 2;
27 }
28
29 done_testing;