4 use Test::More tests => 8;
6 use Test::NoWarnings 1.04 ':early';
10 use_ok('MooseX::Getopt');
17 with 'MooseX::Getopt::Dashes';
19 has 'some_thingy' => ( is => 'ro', isa => 'Str', default => 'foo' );
20 has 'another_thingy' => ( is => 'ro', isa => 'Str', default => 'foo', cmd_flag => 'another_thingy', traits => [ 'Getopt' ], );
24 local @ARGV = (qw/--some-thingy bar/);
25 ok ! exception { is( App->new_with_options->some_thingy, 'bar') }, 'Dash in option name';
29 local @ARGV = (qw/--some_thingy bar/);
30 like exception { App->new_with_options }, qr/Unknown option: some_thingy/;
34 local @ARGV = (qw/--another_thingy bar/);
35 ok ! exception { is( App->new_with_options->another_thingy, 'bar' ) }, 'Underscore in option name';
39 local @ARGV = (qw/--another-thingy bar/);
40 like exception { App->new_with_options }, qr/Unknown option: another-thingy/;