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 /],
59 default => sub { [] },
65 default => sub { {} },
68 has 'private_stuff' => (
78 my $app = App->new_with_options;
79 isa_ok( $app, 'App' );
81 ok( !$app->verbose, '... verbosity is off as expected' );
82 is( $app->length, 24, '... length is 24 as expected' );
83 is( $app->data, 'file.dat', '... data is file.dat as expected' );
84 is_deeply( $app->libs, [], '... libs is [] as expected' );
85 is_deeply( $app->details, {}, '... details is {} as expected' );
86 is($app->private_stuff, 713, '... private stuff is 713 as expected');
90 local @ARGV = (qw/--private_stuff 317/);
92 like exception { App->new_with_options }, qr/Unknown option: private_stuff/;
96 local @ARGV = (qw/--length 100/);
98 like exception { App->new_with_options }, qr/Unknown option: length/;