X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F001_basic.t;h=6c1c1fa4e1fd0b814267f4dab93b1fb8fba9c3a2;hb=50b3ccff5bbcdc77495d6be259b6239527e7f08a;hp=7ffbe5b6f509d63ae0a21cc20627e956672dbb68;hpb=1a8b4ed19c6096c389d094504e81b524d7af7120;p=gitmo%2FMooseX-Getopt.git diff --git a/t/001_basic.t b/t/001_basic.t index 7ffbe5b..6c1c1fa 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 51; +use Test::More tests => 69; BEGIN { use_ok('MooseX::Getopt'); @@ -79,6 +79,14 @@ BEGIN { } +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'); + can_ok($attr, 'cmd_flag'); + can_ok($attr, 'cmd_aliases'); +} + { local @ARGV = (); @@ -206,9 +214,11 @@ BEGIN { # Test ARGV support { - my @args = ('-p', 12345, '-c', 99); + my @args = ('-p', 12345, '-c', 99, '-'); local @ARGV = @args; my $app = App->new_with_options; isa_ok($app, 'App'); - is_deeply($app->ARGV, \@args); + is_deeply($app->ARGV, \@args, 'ARGV accessor'); + is_deeply(\@ARGV, \@args, '@ARGV unmangled'); + is_deeply($app->extra_argv, ['-'], 'extra_argv accessor'); }