X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F004_nogetop.t;h=fd1ecdffa75de431527264029d8a647d6701a27e;hb=c0237b0a50fd50f90dbd2746f0d1f6eb98649d6a;hp=b0fa16dfd86bf96c0bfec3dd1fe7fe9d81b223c8;hpb=bff3807bb402a84be10c48d2e4d1be0628fde911;p=gitmo%2FMooseX-Getopt.git diff --git a/t/004_nogetop.t b/t/004_nogetop.t index b0fa16d..fd1ecdf 100644 --- a/t/004_nogetop.t +++ b/t/004_nogetop.t @@ -1,24 +1,22 @@ -#!/usr/bin/perl - use strict; use warnings; -use Test::More tests => 9; -use Test::Exception; +use Test::More tests => 10; +use Test::Fatal 0.003; +use Test::NoWarnings 1.04 ':early'; BEGIN { use_ok('MooseX::Getopt'); } { - package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( - metaclass => 'MooseX::Getopt::Meta::Attribute', + 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 => 'MooseX::Getopt::Meta::Attribute', + traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', @@ -66,20 +64,19 @@ BEGIN { ); has 'private_stuff' => ( - metaclass => 'MooseX::Getopt::Meta::NoGetopt', + traits => ['NoGetopt'], is => 'ro', isa => 'Int', default => 713 ); has '_private_stuff_cmdline' => ( - metaclass => 'MooseX::Getopt::Meta::Attribute', + traits => ['Getopt'], is => 'ro', isa => 'Int', default => 832, cmd_flag => 'p', ); - } { @@ -99,5 +96,5 @@ 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/; }