stop using Moo as a test package
[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 {
10     package TestHelpScript;
11     use Moose;
12     with 'Catalyst::ScriptRole';
13     our $help;
14     sub print_usage_text { $help++ }
15 }
16
17 test('--help');
18 test('-?');
19
20 sub test {
21     local $TestHelpScript::help;
22     local @ARGV = (@_);
23     is exception {
24         TestHelpScript->new_with_options(application_name => 'TestAppToTestScripts')->run;
25     }, undef, 'Lives';
26     ok $TestHelpScript::help, 'Got help';
27 }
28
29 done_testing;