use strict;
use warnings;
use Test::More;
-use Test::Fatal;
+use Test::Exception;
{
use Moose::Util::TypeConstraints;
$foo->array_int( [] );
is_deeply( $foo->array_int, [], "array_int - correct contents" );
- ok exception { $foo->push_array_int('foo') },
+ dies_ok { $foo->push_array_int('foo') }
"array_int - can't push wrong type";
is_deeply( $foo->array_int, [], "array_int - correct contents" );
}
{
- ok exception { $foo->push_a1('foo') }, "a1 - can't push onto undef";
+ dies_ok { $foo->push_a1('foo') } "a1 - can't push onto undef";
$foo->a1( [] );
is_deeply( $foo->a1, [], "a1 - correct contents" );
- ok exception { $foo->push_a1('foo') }, "a1 - can't push wrong type";
+ dies_ok { $foo->push_a1('foo') } "a1 - can't push wrong type";
is_deeply( $foo->a1, [], "a1 - correct contents" );
}
{
- ok exception { $foo->push_a2('foo') }, "a2 - can't push onto undef";
+ dies_ok { $foo->push_a2('foo') } "a2 - can't push onto undef";
$foo->a2( [] );
is_deeply( $foo->a2, [], "a2 - correct contents" );
$foo->push_a2('foo');
is_deeply( $foo->a2, ['foo'], "a2 - correct contents" );
- ok exception { $foo->push_a2('bar') }, "a2 - can't push more than one element";
+ dies_ok { $foo->push_a2('bar') } "a2 - can't push more than one element";
is_deeply( $foo->a2, ['foo'], "a2 - correct contents" );
}
{
- ok exception { $foo->push_a3(1) }, "a3 - can't push onto undef";
+ dies_ok { $foo->push_a3(1) } "a3 - can't push onto undef";
$foo->a3( [] );
is_deeply( $foo->a3, [], "a3 - correct contents" );
- ok exception { $foo->push_a3('foo') }, "a3 - can't push non-int";
+ dies_ok { $foo->push_a3('foo') } "a3 - can't push non-int";
- ok exception { $foo->push_a3(100) },
+ dies_ok { $foo->push_a3(100) }
"a3 - can't violate overall type constraint";
is_deeply( $foo->a3, [], "a3 - correct contents" );
$foo->push_a3(1);
is_deeply( $foo->a3, [1], "a3 - correct contents" );
- ok exception { $foo->push_a3(100) },
+ dies_ok { $foo->push_a3(100) }
"a3 - can't violate overall type constraint";
is_deeply( $foo->a3, [1], "a3 - correct contents" );