X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F001_basic.t;h=b92f8837db7cd65c9cf5464340c0a0fbbc9d9825;hb=3737d4934e6e7e08050fed04e32c4956aca0d9b6;hp=b7bea2d273e26ac8b40e3b33db06b9c410aa96d9;hpb=2557b52647dda5b9e090b324d950d4a55db74bae;p=gitmo%2FMooseX-Getopt.git diff --git a/t/001_basic.t b/t/001_basic.t index b7bea2d..b92f883 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -1,9 +1,9 @@ -#!/usr/bin/perl - 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'); @@ -16,7 +16,7 @@ BEGIN { with 'MooseX::Getopt'; has 'data' => ( - metaclass => 'MooseX::Getopt::Meta::Attribute', + metaclass => 'Getopt', is => 'ro', isa => 'Str', default => 'file.dat', @@ -32,7 +32,7 @@ BEGIN { ); has 'horse' => ( - metaclass => 'MooseX::Getopt::Meta::Attribute', + traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', @@ -70,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'); }