From: Karen Etheridge Date: Tue, 19 Nov 2013 01:58:34 +0000 (-0800) Subject: convert all uses of Test::Exception to Test::Fatal X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b9208740abb7307813e18d172192f7683ff519d;p=gitmo%2FMooseX-Runnable.git convert all uses of Test::Exception to Test::Fatal --- diff --git a/Changes b/Changes index f452899..bdba8ea 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ Revision history for {{$dist->name}} {{$NEXT}} - converted uses of Path::Class to Path::Tiny (Karen Etheridge) - removed use of deprecated Class::MOP::load_class + - converted uses of Test::Exception to Test::Fatal 0.03 Sat Jun 26 23:19:41 CDT 2010 - modified verification of RunnableClass values to use diff --git a/t/basic-mx-getopt.t b/t/basic-mx-getopt.t index a1dda47..2009128 100644 --- a/t/basic-mx-getopt.t +++ b/t/basic-mx-getopt.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::Exception; +use Test::Fatal; use Test::More tests => 9; use MooseX::Runnable::Invocation; @@ -39,9 +39,9 @@ foreach my $class (qw(Class Class2)) ok $invocation, 'class is instantiatable'; my $code; - lives_ok { + is exception { $code = $invocation->run('--foo', '42', 0); - } 'run lived'; + }, undef, 'run lived'; is $foo, '42', 'got foo from cmdline'; diff --git a/t/basic.t b/t/basic.t index 7a490ae..498e95c 100644 --- a/t/basic.t +++ b/t/basic.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::Exception; +use Test::Fatal; use Test::More tests => 8; use ok 'MooseX::Runnable'; @@ -25,9 +25,9 @@ my $invocation = MooseX::Runnable::Invocation->new( ok $invocation; my $code; -lives_ok { +is exception { $code = $invocation->run(1,2,3); -} 'run lived'; +}, undef, 'run lived'; is $code, 6, 'run worked'; @@ -49,8 +49,8 @@ $invocation = MooseX::Runnable::Invocation->new( ok $invocation; -lives_ok { +is exception { $code = $invocation->run(1,2,3); -} 'run lived'; +}, undef, 'run lived'; is $code, 0, 'run worked, and plugin changed the return code'; diff --git a/t/invocation-plugin-initargs.t b/t/invocation-plugin-initargs.t index 900f9c9..9e1987b 100644 --- a/t/invocation-plugin-initargs.t +++ b/t/invocation-plugin-initargs.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::Exception; +use Test::Fatal; use Test::More tests => 7; use MooseX::Runnable::Invocation; @@ -40,38 +40,38 @@ my $initargs; } my $i; -lives_ok { +is exception { $i = MooseX::Runnable::Invocation->new( class => 'Class', plugins => { '+Plugin' => [qw/foo bar baz/], }, ); -} 'created invocation without dying'; +}, undef, 'created invocation without dying'; ok $i, 'created invocation ok'; ok $i->run, 'ran ok'; is $initargs, 'foo,bar,baz', 'got initargs'; -throws_ok { +like exception { MooseX::Runnable::Invocation->new( class => 'Class', plugins => { '+Argless' => ['args go here'], }, ); -} qr/Perhaps/, 'argless + args = error'; +}, qr/Perhaps/, 'argless + args = error'; -lives_ok { +is exception { MooseX::Runnable::Invocation->new( class => 'Class', plugins => { '+Argless' => [], }, ); -} 'argless + no args = ok'; +}, undef, 'argless + no args = ok'; -lives_ok { +is exception { MooseX::Runnable::Invocation->new( class => 'Class', plugins => { @@ -79,4 +79,4 @@ lives_ok { '+Plugin2' => [], }, ); -} 'two plugins with args compose OK'; +}, undef, 'two plugins with args compose OK';