6 use Test::More tests => 9;
10 use_ok('MooseX::Getopt');
18 with 'MooseX::Getopt';
21 metaclass => 'MooseX::Getopt::Meta::Attribute',
24 default => 'file.dat',
29 metaclass => 'Getopt',
33 cmd_aliases => [qw/ moocow m c /],
37 metaclass => 'MooseX::Getopt::Meta::Attribute',
59 default => sub { [] },
65 default => sub { {} },
68 has 'private_stuff' => (
69 metaclass => 'MooseX::Getopt::Meta::NoGetopt',
75 has '_private_stuff_cmdline' => (
76 metaclass => 'MooseX::Getopt::Meta::Attribute',
88 my $app = App->new_with_options;
89 isa_ok( $app, 'App' );
91 ok( !$app->verbose, '... verbosity is off as expected' );
92 is( $app->length, 24, '... length is 24 as expected' );
93 is( $app->data, 'file.dat', '... data is file.dat as expected' );
94 is_deeply( $app->libs, [], '... libs is [] as expected' );
95 is_deeply( $app->details, {}, '... details is {} as expected' );
96 is($app->private_stuff, 713, '... private stuff is 713 as expected');
100 local @ARGV = (qw/--private_stuff 317/);
102 throws_ok { App->new_with_options } qr/Unknown option: private_stuff/;