X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F005_strict.t;h=9c79115a2c605e6eae331e36c27cf1287266a148;hb=40a0a2081957d55e49da795a9255db61be85fe2d;hp=858437bde88fa2073b860647d91acee81ff24e41;hpb=0f8232b66e0f72e35099ce203962a4efc23838cf;p=gitmo%2FMooseX-Getopt.git diff --git a/t/005_strict.t b/t/005_strict.t index 858437b..9c79115 100644 --- a/t/005_strict.t +++ b/t/005_strict.t @@ -1,24 +1,22 @@ -#!/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'); } { - package App; use Moose; with 'MooseX::Getopt::Strict'; has 'data' => ( - metaclass => 'Getopt', + traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'file.dat', @@ -26,7 +24,7 @@ BEGIN { ); has 'cow' => ( - metaclass => 'Getopt', + traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'moo', @@ -34,7 +32,7 @@ BEGIN { ); has 'horse' => ( - metaclass => 'Getopt', + traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', @@ -70,14 +68,6 @@ BEGIN { isa => 'Int', default => 713 ); - - has '_private_stuff_cmdline' => ( - is => 'ro', - isa => 'Int', - default => 832, - cmd_flag => 'p', - ); - } { @@ -97,5 +87,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/; +} +