Commit | Line | Data |
---|---|---|
4f0612fd | 1 | #!/usr/bin/env perl |
2 | use strict; | |
3 | use warnings; | |
4 | use Test::More; | |
fb533ac3 | 5 | use Test::Exception; |
4f0612fd | 6 | |
7 | use FindBin qw/$Bin/; | |
8 | use lib "$Bin/../lib"; | |
9 | ||
10 | { | |
11 | package TestHelpScript; | |
12 | use Moose; | |
13 | with 'Catalyst::ScriptRole'; | |
14 | our $help; | |
3a8c155f | 15 | sub _getopt_full_usage { $help++ } |
4f0612fd | 16 | } |
fb533ac3 | 17 | |
fb533ac3 | 18 | test('--help'); |
3a8c155f | 19 | test('-?'); |
fb533ac3 | 20 | |
21 | sub test { | |
4f0612fd | 22 | local $TestHelpScript::help; |
fb533ac3 | 23 | local @ARGV = (@_); |
24 | lives_ok { | |
25 | TestHelpScript->new_with_options(application_name => 'TestAppToTestScripts')->run; | |
3a8c155f | 26 | } 'Lives'; |
27 | ok $TestHelpScript::help, 'Got help'; | |
4f0612fd | 28 | } |
29 | ||
30 | done_testing; |