-use Test::More tests => 4;
+use strictures;
+use Test::More;
+use Test::Fatal;
-ok(eval {
+is(exception {
package Local::Test::Role1;
use Moo::Role;
has [qw/ attr1 attr2 /] => (is => 'ro');
- 1;
-}, 'has \@attrs works in roles')
- or diag "EVAL FAILED: $@";
+}, undef, 'has \@attrs works in roles');
-ok eval {
+is(exception {
package Local::Test::Class1;
use Moo;
with 'Local::Test::Role1';
has [qw/ attr3 attr4 /] => (is => 'ro');
- 1;
-}, 'has \@attrs works in classes'
- or diag "EVAL FAILED: $@";
+}, undef, 'has \@attrs works in classes');
my $obj = new_ok 'Local::Test::Class1' => [
attr1 => 1,
$obj,
qw( attr1 attr2 attr3 attr4 ),
);
+
+done_testing;