Commit | Line | Data |
7b566394 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More tests => 3; |
7 | |
8 | { |
9 | package App; |
10 | use Moose; |
11 | with qw(MooseX::Getopt); |
12 | |
13 | has 'TrackingNumber' => ( |
14 | is => 'rw', |
15 | isa => 'Str', |
16 | ); |
17 | |
18 | has 'otherparam' => ( |
19 | is => 'rw', |
20 | isa => 'Str', |
21 | ); |
22 | } |
23 | |
24 | { |
25 | local @ARGV = ('--TrackingNumber','1Z1234567812345670','--otherparam','foo'); |
26 | |
27 | my $app = App->new_with_options; |
28 | isa_ok($app, 'App'); |
29 | is($app->TrackingNumber, '1Z1234567812345670', '... TrackingNumber is as expected'); |
30 | is($app->otherparam, 'foo', '... otherparam is as expected'); |
31 | } |