use warnings tester with fewer dependencies, issues
[gitmo/MooseX-Getopt.git] / t / 001_basic.t
index de997ad..b92f883 100644 (file)
@@ -1,7 +1,9 @@
 use strict;
-use warnings;
+use warnings FATAL => 'all';
 
-use Test::More tests => 69;
+use Test::More tests => 70;
+use Test::Moose;
+use Test::Warnings;
 
 BEGIN {
     use_ok('MooseX::Getopt');
@@ -14,7 +16,7 @@ BEGIN {
     with 'MooseX::Getopt';
 
     has 'data' => (
-        metaclass => 'MooseX::Getopt::Meta::Attribute',
+        metaclass => 'Getopt',
         is        => 'ro',
         isa       => 'Str',
         default   => 'file.dat',
@@ -30,7 +32,7 @@ BEGIN {
     );
 
     has 'horse' => (
-        metaclass   => 'MooseX::Getopt::Meta::Attribute',
+        traits      => ['Getopt'],
         is          => 'ro',
         isa         => 'Str',
         default     => 'bray',
@@ -68,19 +70,25 @@ BEGIN {
     );
 
     has '_private_stuff_cmdline' => (
-        metaclass => 'MooseX::Getopt::Meta::Attribute',
+        traits    => ['Getopt'],
         is        => 'ro',
         isa       => 'Int',
         default   => 832,
         cmd_flag  => 'p',
     );
-
 }
 
 foreach my $attr_name (qw(data cow horse _private_stuff_cmdline)) {
     my $attr = App->meta->get_attribute($attr_name);
     isa_ok($attr, 'Moose::Meta::Attribute');
-    isa_ok($attr, 'MooseX::Getopt::Meta::Attribute');
+    if ($attr_name eq 'data' or $attr_name eq 'cow')
+    {
+        isa_ok($attr, 'MooseX::Getopt::Meta::Attribute');
+    }
+    else
+    {
+        does_ok($attr, 'MooseX::Getopt::Meta::Attribute::Trait');
+    }
     can_ok($attr, 'cmd_flag');
     can_ok($attr, 'cmd_aliases');
 }