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