Remove some more trailing whitespace
[gitmo/MooseX-Getopt.git] / t / 009_gld_and_explicit_options.t
CommitLineData
0df9248e 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
630657d5 6use Test::More;
0df9248e 7use Test::Exception;
8
2557b526 9BEGIN {
630657d5 10 eval 'use Getopt::Long::Descriptive;';
11 plan skip_all => "Getopt::Long::Descriptive required for this test" if $@;
12 plan tests => 5;
13 use_ok('MooseX::Getopt');
14}
0df9248e 15
16{
17 package Testing::Foo;
18 use Moose;
2557b526 19
0df9248e 20 with 'MooseX::Getopt';
2557b526 21
0df9248e 22 has 'bar' => (
23 is => 'ro',
2557b526 24 isa => 'Int',
0df9248e 25 required => 1,
26 );
2557b526 27
0df9248e 28 has 'baz' => (
29 is => 'ro',
2557b526 30 isa => 'Int',
31 required => 1,
32 );
0df9248e 33}
34
b56c8123 35@ARGV = qw(--bar 10);
0df9248e 36
37my $foo;
38lives_ok {
39 $foo = Testing::Foo->new_with_options(baz => 100);
40} '... this should work';
41isa_ok($foo, 'Testing::Foo');
42
43is($foo->bar, 10, '... got the right values');
44is($foo->baz, 100, '... got the right values');
45
46
47
48
49