Remove most of the horrible
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_script_help.t
CommitLineData
4f0612fd 1#!/usr/bin/env perl
2use strict;
3use warnings;
4use Test::More;
fb533ac3 5use Test::Exception;
4f0612fd 6
7use FindBin qw/$Bin/;
8use 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
19test('-h');
20test('--help');
21
22TODO: {
23 local $TODO = 'This is bork';
24 test('-?');
4f0612fd 25}
fb533ac3 26
27sub 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
36done_testing;