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