X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F005_strict.t;h=03eaf50a2a625d037cf7a4fc0da3ba5398464c98;hb=9fbb5be9dcf64475fb6f4d25807db1e952be2365;hp=858437bde88fa2073b860647d91acee81ff24e41;hpb=0f8232b66e0f72e35099ce203962a4efc23838cf;p=gitmo%2FMooseX-Getopt.git diff --git a/t/005_strict.t b/t/005_strict.t index 858437b..03eaf50 100644 --- a/t/005_strict.t +++ b/t/005_strict.t @@ -1,10 +1,9 @@ -#!/usr/bin/perl - use strict; use warnings; -use Test::More tests => 9; -use Test::Exception; +use Test::More tests => 11; +use Test::Fatal; +use Test::NoWarnings 1.04 ':early'; BEGIN { use_ok('MooseX::Getopt'); @@ -34,7 +33,7 @@ BEGIN { ); has 'horse' => ( - metaclass => 'Getopt', + traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', @@ -70,14 +69,6 @@ BEGIN { isa => 'Int', default => 713 ); - - has '_private_stuff_cmdline' => ( - is => 'ro', - isa => 'Int', - default => 832, - cmd_flag => 'p', - ); - } { @@ -97,5 +88,12 @@ BEGIN { { local @ARGV = (qw/--private_stuff 317/); - throws_ok { App->new_with_options } qr/Unknown option: private_stuff/; + like exception { App->new_with_options }, qr/Unknown option: private_stuff/; } + +{ + local @ARGV = (qw/--length 100/); + + like exception { App->new_with_options }, qr/Unknown option: length/; +} +