if configfile is a coderef call it and write some tests for it
[gitmo/MooseX-Getopt.git] / t / 005_strict.t
index 096ace9..206cb64 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 9;
+use Test::More tests => 10;
 use Test::Exception;
 
 BEGIN {
@@ -18,7 +18,7 @@ BEGIN {
     with 'MooseX::Getopt::Strict';
 
     has 'data' => (
-        metaclass => 'MooseX::Getopt::Meta::Attribute',
+        metaclass => 'Getopt',
         is        => 'ro',
         isa       => 'Str',
         default   => 'file.dat',
@@ -34,7 +34,7 @@ BEGIN {
     );
 
     has 'horse' => (
-        metaclass   => 'MooseX::Getopt::Meta::Attribute',
+        metaclass   => 'Getopt',
         is          => 'ro',
         isa         => 'Str',
         default     => 'bray',
@@ -70,14 +70,6 @@ BEGIN {
         isa      => 'Int',
         default  => 713
     );
-
-    has '_private_stuff_cmdline' => (
-        is        => 'ro',
-        isa       => 'Int',
-        default   => 832,
-        cmd_flag  => 'p',
-    );
-
 }
 
 {
@@ -99,3 +91,10 @@ BEGIN {
 
     throws_ok { App->new_with_options } qr/Unknown option: private_stuff/;
 }
+
+{
+    local @ARGV = (qw/--length 100/);
+
+    throws_ok { App->new_with_options } qr/Unknown option: length/;
+}
+