use warnings tester with fewer dependencies, issues
[gitmo/MooseX-Getopt.git] / t / 011_process_argv.t
index 01c55bb..fdd8136 100644 (file)
@@ -1,20 +1,9 @@
-#!/usr/bin/perl
-
 use strict;
-use warnings;
-
-use Test::More;
-use Test::Exception;
+use warnings FATAL => 'all';
 
-if ( !eval { require Test::Deep } )
-{
-    plan skip_all => 'Test requires Test::Deep';
-    exit;
-}
-else
-{
-    plan tests => 6;
-}
+use Test::More tests => 7;
+use Test::Fatal 0.003;
+use Test::Warnings;
 
 {
     package Testing::Foo;
@@ -38,22 +27,26 @@ else
 @ARGV = qw(--bar 10 file.dat);
 
 my $pa;
-lives_ok {
-    $pa = Testing::Foo->process_argv(baz => 100);
-} '... this should work';
+is(
+    exception {
+        $pa = Testing::Foo->process_argv(baz => 100);
+    },
+    undef,
+    '... this should work'
+);
 isa_ok($pa, 'MooseX::Getopt::ProcessedArgv');
 
-Test::Deep::cmp_deeply($pa->argv_copy, [
+is_deeply($pa->argv_copy, [
     '--bar',
     '10',
     'file.dat'
 ], 'argv_copy');
-Test::Deep::cmp_deeply($pa->cli_params, {
+is_deeply($pa->cli_params, {
     'bar' => 10
 }, 'cli_params');
-Test::Deep::cmp_deeply($pa->constructor_params, {
+is_deeply($pa->constructor_params, {
     'baz' => 100
 }, 'constructor_params');
-Test::Deep::cmp_deeply($pa->extra_argv, [
+is_deeply($pa->extra_argv, [
     'file.dat'
 ], 'extra_argv');