X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F005_strict.t;h=9c79115a2c605e6eae331e36c27cf1287266a148;hb=c0237b0a50fd50f90dbd2746f0d1f6eb98649d6a;hp=8a8d634fdd1e7b1778fb813cbe180d158ed87698;hpb=6ac028c4d869259041b7c526071cf614ffb033fa;p=gitmo%2FMooseX-Getopt.git diff --git a/t/005_strict.t b/t/005_strict.t index 8a8d634..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 => 10; -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,12 +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/); - throws_ok { App->new_with_options } qr/Unknown option: length/; + like exception { App->new_with_options }, qr/Unknown option: length/; }