use warnings;
use Test::More;
-use Test::Exception;
+use Test::Fatal;
=pod
for (1..2) {
my $is_immutable = Foo->meta->is_immutable;
my $mutable_string = $is_immutable ? 'immutable' : 'mutable';
- lives_ok {
+ is( exception {
my $f = Foo->new(foo => 10, bar => "Hello World", baz => 10, zot => 4);
is($f->moo, 69, "Type coercion works as expected on default ($mutable_string)");
is($f->boo, 69, "Type coercion works as expected on builder ($mutable_string)");
- } "... this passes the constuctor correctly ($mutable_string)";
+ }, undef, "... this passes the constuctor correctly ($mutable_string)" );
- lives_ok {
+ is( exception {
Foo->new(foo => 10, bar => "Hello World", baz => 10, zot => "not an int");
- } "... the constructor doesn't care about 'zot' ($mutable_string)";
+ }, undef, "... the constructor doesn't care about 'zot' ($mutable_string)" );
- dies_ok {
+ isnt( exception {
Foo->new(foo => "Hello World", bar => 100, baz => "Hello World");
- } "... this fails the constuctor correctly ($mutable_string)";
+ }, undef, "... this fails the constuctor correctly ($mutable_string)" );
Foo->meta->make_immutable(debug => 0) unless $is_immutable;
}