X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Getopt.git;a=blobdiff_plain;f=t%2F104_override_usage.t;h=8e7a1ff842d173694ae4a2453a51d1c394940fce;hp=887844b9d9f1c60ddc8004a02a74a9120bb243ac;hb=c885acae4797dc3ce50e91445ceb96c971e87671;hpb=3aaa34a1cf97648e9704fc9c73abc4ebd8f90b39 diff --git a/t/104_override_usage.t b/t/104_override_usage.t index 887844b..8e7a1ff 100644 --- a/t/104_override_usage.t +++ b/t/104_override_usage.t @@ -1,7 +1,7 @@ use strict; use warnings; use Test::More 0.88; -use Test::Fatal; +use Test::Trap; { package MyScript; @@ -29,13 +29,15 @@ use Test::Fatal; { local $MyScript::usage; local @MyScript::warnings; local @MyScript::exception; local @ARGV = ('--help'); - like exception { MyScript->new_with_options }, qr/A foo/; + trap { MyScript->new_with_options }; + like($trap->stdout, qr/A foo/); is $MyScript::usage, 1; } { local $MyScript::usage; local @MyScript::warnings; local @MyScript::exception; local @ARGV = ('-q'); # Does not exist - like exception { MyScript->new_with_options }, qr/A foo/; + trap { MyScript->new_with_options }; + like($trap->die, qr/A foo/); is_deeply \@MyScript::warnings, [ 'Unknown option: q '