use strict;
use warnings;
-use Test::More tests => 9;
-use Test::Exception;
+use Test::More tests => 10;
+use Test::Fatal;
BEGIN {
use_ok('MooseX::Getopt');
);
has 'horse' => (
- metaclass => 'Getopt',
+ traits => ['Getopt'],
is => 'ro',
isa => 'Str',
default => 'bray',
isa => 'Int',
default => 713
);
-
- has '_private_stuff_cmdline' => (
- is => 'ro',
- isa => 'Int',
- default => 832,
- cmd_flag => 'p',
- );
-
}
{
{
local @ARGV = (qw/--private_stuff 317/);
- throws_ok { App->new_with_options } qr/Unknown option: private_stuff/;
+ like exception { App->new_with_options }, qr/Unknown option: private_stuff/;
}
+
+{
+ local @ARGV = (qw/--length 100/);
+
+ like exception { App->new_with_options }, qr/Unknown option: length/;
+}
+