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