use inlined module hiding in tests
[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
9{
10 package TestHelpScript;
11 use Moose;
12 with 'Catalyst::ScriptRole';
13 our $help;
8ba29999 14 sub print_usage_text { $help++ }
4f0612fd 15}
fb533ac3 16
fb533ac3 17test('--help');
3a8c155f 18test('-?');
fb533ac3 19
20sub test {
4f0612fd 21 local $TestHelpScript::help;
fb533ac3 22 local @ARGV = (@_);
2a56ace9 23 is exception {
fb533ac3 24 TestHelpScript->new_with_options(application_name => 'TestAppToTestScripts')->run;
2a56ace9 25 }, undef, 'Lives';
3a8c155f 26 ok $TestHelpScript::help, 'Got help';
4f0612fd 27}
28
29done_testing;