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