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