use Moose ();
use Moose::Util::TypeConstraints;
use NoInlineAttribute;
-use Test::Fatal;
+use Test::Exception;
use Test::More;
use Test::Moose;
is( $obj->inc_counter, 2, 'inc returns new value' );
is( $obj->counter, 2, '... got the incremented value (again)' );
- like exception { $obj->inc_counter( 1, 2 ) },
+ throws_ok { $obj->inc_counter( 1, 2 ) }
qr/Cannot call inc with more than 1 argument/,
'inc throws an error when two arguments are passed';
is( $obj->dec_counter, 1, 'dec returns new value' );
is( $obj->counter, 1, '... got the decremented value' );
- like exception { $obj->dec_counter( 1, 2 ) },
+ throws_ok { $obj->dec_counter( 1, 2 ) }
qr/Cannot call dec with more than 1 argument/,
'dec throws an error when two arguments are passed';
is( $obj->reset_counter, 0, 'reset returns new value' );
is( $obj->counter, 0, '... got the original value' );
- like exception { $obj->reset_counter(2) },
+ throws_ok { $obj->reset_counter(2) }
qr/Cannot call reset with any arguments/,
'reset throws an error when an argument is passed';
is( $obj->set_counter(5), 5, 'set returns new value' );
is( $obj->counter, 5, '... set the value' );
- like exception { $obj->set_counter( 1, 2 ) },
+ throws_ok { $obj->set_counter( 1, 2 ) }
qr/Cannot call set with more than 1 argument/,
'set throws an error when two arguments are passed';