X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Getopt.git;a=blobdiff_plain;f=t%2F005_strict.t;h=f768d8b6266d51491c76e185e945e8a42f570148;hp=8a8d634fdd1e7b1778fb813cbe180d158ed87698;hb=aec092482d5b90b8279e4a5f92165868a78ddf32;hpb=6ac028c4d869259041b7c526071cf614ffb033fa diff --git a/t/005_strict.t b/t/005_strict.t index 8a8d634..f768d8b 100644 --- a/t/005_strict.t +++ b/t/005_strict.t @@ -1,24 +1,22 @@ -#!/usr/bin/perl - use strict; -use warnings; +use warnings FATAL => 'all'; -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/; }