Commit | Line | Data |
---|---|---|
4f0612fd | 1 | use strict; |
2 | use warnings; | |
3 | use Test::More; | |
2a56ace9 | 4 | use Test::Fatal; |
4f0612fd | 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; | |
8ba29999 | 14 | sub print_usage_text { $help++ } |
4f0612fd | 15 | } |
fb533ac3 | 16 | |
fb533ac3 | 17 | test('--help'); |
3a8c155f | 18 | test('-?'); |
fb533ac3 | 19 | |
20 | sub 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 | ||
29 | done_testing; |