X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F002_custom_option_type.t;h=80417fe9b4f64a6f16d5fd1e7fdc73563f68ab68;hb=ede2de16018159d8e1d70f53aedece5ae2d4f299;hp=11cf7090a9e55b43eedded198ab4374eb65bc405;hpb=c0237b0a50fd50f90dbd2746f0d1f6eb98649d6a;p=gitmo%2FMooseX-Getopt.git diff --git a/t/002_custom_option_type.t b/t/002_custom_option_type.t index 11cf709..80417fe 100644 --- a/t/002_custom_option_type.t +++ b/t/002_custom_option_type.t @@ -1,8 +1,9 @@ use strict; -use warnings; +use warnings FATAL => 'all'; use Test::More tests => 7; -use Test::NoWarnings 1.04 ':early'; +use Test::Warnings; +use Test::Fatal; BEGIN { use_ok('MooseX::Getopt'); @@ -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', +);