X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F002_custom_option_type.t;h=5c0eb90c44eed5f727b08cbda84eaf8fa956c50a;hb=aec092482d5b90b8279e4a5f92165868a78ddf32;hp=553a9fa8841edfc4ca4463e6b0ae92f06431ef74;hpb=da7b9880cfa75cdc3f3a4903e9ed7bfc86b534a3;p=gitmo%2FMooseX-Getopt.git diff --git a/t/002_custom_option_type.t b/t/002_custom_option_type.t index 553a9fa..5c0eb90 100644 --- a/t/002_custom_option_type.t +++ b/t/002_custom_option_type.t @@ -1,7 +1,9 @@ use strict; -use warnings; +use warnings FATAL => 'all'; -use Test::More tests => 6; +use Test::More tests => 7; +use Test::NoWarnings 1.04 ':early'; +use Test::Fatal; BEGIN { use_ok('MooseX::Getopt'); @@ -29,7 +31,6 @@ BEGIN { isa => 'ArrayOfInts', default => sub { [0] } ); - } { @@ -53,9 +54,11 @@ BEGIN { # Make sure it really used our =i@, instead of falling back # to =s@ via the type system, and test that exceptions work # while we're at it. -eval { - local @ARGV = ('--nums', 3, '--nums', 'foo'); - - my $app = App->new_with_options; -}; -like($@, qr/Value "foo" invalid/, 'Numeric constraint enforced'); +like( + exception { + local @ARGV = ('--nums', 3, '--nums', 'foo'); + my $app = App->new_with_options; + }, + qr/Value "foo" invalid/, + 'Numeric constraint enforced', +);