test for warnings everywhere
[gitmo/MooseX-Getopt.git] / t / 005_strict.t
index 8a8d634..03eaf50 100644 (file)
@@ -1,10 +1,9 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
-use Test::More tests => 10;
-use Test::Exception;
+use Test::More tests => 11;
+use Test::Fatal;
+use Test::NoWarnings 1.04 ':early';
 
 BEGIN {
     use_ok('MooseX::Getopt');
@@ -34,7 +33,7 @@ BEGIN {
     );
 
     has 'horse' => (
-        metaclass   => 'Getopt',
+        traits      => ['Getopt'],
         is          => 'ro',
         isa         => 'Str',
         default     => 'bray',
@@ -70,14 +69,6 @@ BEGIN {
         isa      => 'Int',
         default  => 713
     );
-
-    has '_private_stuff_cmdline' => (
-        is        => 'ro',
-        isa       => 'Int',
-        default   => 832,
-        cmd_flag  => 'p',
-    );
-
 }
 
 {
@@ -97,12 +88,12 @@ BEGIN {
 {
     local @ARGV = (qw/--private_stuff 317/);
 
-    throws_ok { App->new_with_options } qr/Unknown option: private_stuff/;
+    like exception { App->new_with_options }, qr/Unknown option: private_stuff/;
 }
 
 {
     local @ARGV = (qw/--length 100/);
 
-    throws_ok { App->new_with_options } qr/Unknown option: length/;
+    like exception { App->new_with_options }, qr/Unknown option: length/;
 }