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