use warnings tester with fewer dependencies, issues
[gitmo/MooseX-Getopt.git] / t / 002_custom_option_type.t
index 553a9fa..80417fe 100644 (file)
@@ -1,7 +1,9 @@
 use strict;
-use warnings;
+use warnings FATAL => 'all';
 
-use Test::More tests => 6;
+use Test::More tests => 7;
+use Test::Warnings;
+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',
+);