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'; |
d1fb4964 |
14 | __PACKAGE__->meta->get_attribute('help')->cmd_aliases('h'); |
4f0612fd |
15 | our $help; |
16 | sub _exit_with_usage { $help++ } |
17 | } |
fb533ac3 |
18 | |
19 | test('-h'); |
20 | test('--help'); |
21 | |
22 | TODO: { |
23 | local $TODO = 'This is bork'; |
24 | test('-?'); |
4f0612fd |
25 | } |
fb533ac3 |
26 | |
27 | sub test { |
4f0612fd |
28 | local $TestHelpScript::help; |
fb533ac3 |
29 | local @ARGV = (@_); |
30 | lives_ok { |
31 | TestHelpScript->new_with_options(application_name => 'TestAppToTestScripts')->run; |
32 | }; |
33 | ok $TestHelpScript::help; |
4f0612fd |
34 | } |
35 | |
36 | done_testing; |