make all warnings fatal in tests
[gitmo/MooseX-Getopt.git] / t / 101_argv_bug.t
CommitLineData
f7655c45 1use strict;
aec09248 2use warnings FATAL => 'all';
f7655c45 3
9fbb5be9 4use Test::More tests => 4;
5use Test::NoWarnings 1.04 ':early';
f7655c45 6
5bc5175c 7use MooseX::Getopt;
f7655c45 8
9{
10 package App;
11 use Moose;
f7655c45 12
5bc5175c 13 with 'MooseX::Getopt';
f7655c45 14
15 has 'length' => (
16 is => 'ro',
17 isa => 'Int',
5bc5175c 18 default => 24,
f7655c45 19 );
20
21 has 'verbose' => (
22 is => 'ro',
5bc5175c 23 isa => 'Bool',
24 default => 0,
f7655c45 25 );
5bc5175c 26 no Moose;
f7655c45 27}
28
29{
30 my $app = App->new_with_options(argv => [ '--verbose', '--length', 50 ]);
f7655c45 31 isa_ok($app, 'App');
32
f7655c45 33 ok($app->verbose, '... verbosity is turned on as expected');
5bc5175c 34 is($app->length, 50, '... length is 50 as expected');
f7655c45 35}
36