X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F009_gld_and_explicit_options.t;h=bf1a376ac6d4fd640f62a6451d5f1194b5a05dfe;hb=9fbb5be9dcf64475fb6f4d25807db1e952be2365;hp=189a0c35264347917bbf0ca5b34fa5ce54c23b4c;hpb=b56c81234573df88729d5ce348bb460470abc4ff;p=gitmo%2FMooseX-Getopt.git diff --git a/t/009_gld_and_explicit_options.t b/t/009_gld_and_explicit_options.t index 189a0c3..bf1a376 100644 --- a/t/009_gld_and_explicit_options.t +++ b/t/009_gld_and_explicit_options.t @@ -1,38 +1,41 @@ -#!/usr/bin/perl - use strict; use warnings; -use Test::More tests => 5; -use Test::Exception; +use Test::More tests => 6; +use Test::Fatal; +use Test::NoWarnings 1.04 ':early'; + +use Test::Requires { + 'Getopt::Long::Descriptive' => 0.01, # skip all if not installed +}; -BEGIN { use_ok('MooseX::Getopt') } +use_ok('MooseX::Getopt'); { package Testing::Foo; use Moose; - + with 'MooseX::Getopt'; - + has 'bar' => ( is => 'ro', - isa => 'Int', + isa => 'Int', required => 1, ); - + has 'baz' => ( is => 'ro', - isa => 'Int', - required => 1, - ); + isa => 'Int', + required => 1, + ); } @ARGV = qw(--bar 10); my $foo; -lives_ok { +ok ! exception { $foo = Testing::Foo->new_with_options(baz => 100); -} '... this should work'; +}, '... this should work'; isa_ok($foo, 'Testing::Foo'); is($foo->bar, 10, '... got the right values');