use warnings tester with fewer dependencies, issues
[gitmo/MooseX-Getopt.git] / t / 111_gld_pass_through.t
CommitLineData
0611312e 1use strict;
aec09248 2use warnings FATAL => 'all';
0611312e 3
9fbb5be9 4use Test::More tests => 6;
25eb430d 5use Test::Warnings;
0611312e 6
12f4bf75 7use Getopt::Long::Descriptive;
0611312e 8
9use_ok('MooseX::Getopt::GLD');
10
11{
12 package Engine::Foo;
13 use Moose;
14
15 with 'MooseX::Getopt::GLD' => { getopt_conf => [ 'pass_through' ] };
16
17 has 'foo' => (
0611312e 18 is => 'ro',
19 isa => 'Int',
20 );
21}
22
23{
24 package Engine::Bar;
25 use Moose;
26
27 with 'MooseX::Getopt::GLD' => { getopt_conf => [ 'pass_through' ] };;
28
29 has 'bar' => (
0611312e 30 is => 'ro',
31 isa => 'Int',
32 );
33}
34
35local @ARGV = ('--foo=10', '--bar=42');
36
37{
38 my $foo = Engine::Foo->new_with_options();
39 isa_ok($foo, 'Engine::Foo');
40 is($foo->foo, 10, '... got the right value (10)');
41}
42
43{
44 my $bar = Engine::Bar->new_with_options();
45 isa_ok($bar, 'Engine::Bar');
46 is($bar->bar, 42, '... got the right value (42)');
47}
48
49
50