X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_script_help.t;fp=t%2Faggregate%2Funit_core_script_help.t;h=0850fd6d4ae205a5e21c99cc068c443ae2576409;hb=4f0612fdbc3922b6b32f9f30269849a51995b4f3;hp=0000000000000000000000000000000000000000;hpb=04f4497ce7970ce629d1028861d0f3a9906c950a;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_script_help.t b/t/aggregate/unit_core_script_help.t new file mode 100644 index 0000000..0850fd6 --- /dev/null +++ b/t/aggregate/unit_core_script_help.t @@ -0,0 +1,29 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use FindBin qw/$Bin/; +use lib "$Bin/../lib"; + +{ + package TestHelpScript; + use Moose; + with 'Catalyst::ScriptRole'; + our $help; + sub _exit_with_usage { $help++ } +} +{ + local $TestHelpScript::help; + local @ARGV = ('-h'); + TestHelpFromScriptCGI->new_with_options(application_name => 'TestAppToTestScripts')->run; + ok $TestHelpFromScriptCGI::help, 1; +} +{ + local $TestHelpScript::help; + local @ARGV = ('--help'); + TestHelpFromScriptCGI->new_with_options(application_name => 'TestAppToTestScripts')->run; + is $TestHelpFromScriptCGI::help, 2; +} + +done_testing;