From: Brandon L Black Date: Mon, 2 Apr 2007 21:36:23 +0000 (+0000) Subject: add a new test X-Git-Tag: 0_02~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Getopt.git;a=commitdiff_plain;h=b1b9da6a756893159c3f369676279e1e718da084 add a new test --- diff --git a/t/001_basic.t b/t/001_basic.t index 96bb429..039effb 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 47; +use Test::More tests => 49; BEGIN { use_ok('MooseX::Getopt'); @@ -61,7 +61,21 @@ BEGIN { is => 'ro', isa => 'HashRef', default => sub { {} }, - ); + ); + + has '_private_stuff' => ( + is => 'ro', + isa => 'Int', + default => 713 + ); + + has '_private_stuff_cmdline' => ( + metaclass => 'MooseX::Getopt::Meta::Attribute', + is => 'ro', + isa => 'Int', + default => 832, + cmd_flag => 'p', + ); } @@ -181,3 +195,11 @@ BEGIN { isa_ok($app, 'App'); is($app->horse, 321, 'cmd_alias+cmd_flag, using alias'); } + +# Test _foo + cmd_flag +{ + local @ARGV = ('-p', '666'); + my $app = App->new_with_options; + isa_ok($app, 'App'); + is($app->_private_stuff_cmdline, 666, '_foo + cmd_flag'); +}