10 eval 'use Getopt::Long::Descriptive;';
11 plan skip_all => "Getopt::Long::Descriptive required for this test" if $@;
13 use_ok('MooseX::Getopt');
20 with 'MooseX::Getopt';
37 local @ARGV = qw(--bar 10);
39 my $parser = MooseX::Getopt::Parser::Descriptive->new;
40 isa_ok($parser, 'MooseX::Getopt::Parser::Descriptive');
42 my $getopt = MooseX::Getopt::Session->new(parser => $parser, options => {baz => 100});
46 $foo = Testing::Foo->new_with_options(getopt => $getopt);
47 } '... this should work';
48 isa_ok($foo, 'Testing::Foo');
50 is($foo->bar, 10, '... got the right values');
51 is($foo->baz, 100, '... got the right values');
56 local @ARGV = qw(--bar 10);
60 $foo = Testing::Foo->new_with_options(baz => 100);
61 } '... this should work';
62 isa_ok($foo, 'Testing::Foo');
64 is($foo->bar, 10, '... got the right values');
65 is($foo->baz, 100, '... got the right values');