convert all uses of Test::Exception to Test::Fatal
[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;
2a56ace9 5use Test::Fatal;
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;
8ba29999 15 sub print_usage_text { $help++ }
4f0612fd 16}
fb533ac3 17
fb533ac3 18test('--help');
3a8c155f 19test('-?');
fb533ac3 20
21sub test {
4f0612fd 22 local $TestHelpScript::help;
fb533ac3 23 local @ARGV = (@_);
2a56ace9 24 is exception {
fb533ac3 25 TestHelpScript->new_with_options(application_name => 'TestAppToTestScripts')->run;
2a56ace9 26 }, undef, 'Lives';
3a8c155f 27 ok $TestHelpScript::help, 'Got help';
4f0612fd 28}
29
30done_testing;