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