make all warnings fatal in tests
[gitmo/MooseX-Getopt.git] / t / 009_gld_and_explicit_options.t
CommitLineData
0df9248e 1use strict;
aec09248 2use warnings FATAL => 'all';
0df9248e 3
9fbb5be9 4use Test::More tests => 6;
aabf4179 5use Test::Fatal;
9fbb5be9 6use Test::NoWarnings 1.04 ':early';
0df9248e 7
12f4bf75 8use Getopt::Long::Descriptive;
6a378fbd 9
10use_ok('MooseX::Getopt');
0df9248e 11
12{
13 package Testing::Foo;
14 use Moose;
2557b526 15
0df9248e 16 with 'MooseX::Getopt';
2557b526 17
0df9248e 18 has 'bar' => (
19 is => 'ro',
2557b526 20 isa => 'Int',
0df9248e 21 required => 1,
22 );
2557b526 23
0df9248e 24 has 'baz' => (
25 is => 'ro',
2557b526 26 isa => 'Int',
27 required => 1,
28 );
0df9248e 29}
30
b56c8123 31@ARGV = qw(--bar 10);
0df9248e 32
33my $foo;
aabf4179 34ok ! exception {
0df9248e 35 $foo = Testing::Foo->new_with_options(baz => 100);
aabf4179 36}, '... this should work';
0df9248e 37isa_ok($foo, 'Testing::Foo');
38
39is($foo->bar, 10, '... got the right values');
40is($foo->baz, 100, '... got the right values');
41
42
43
44
45