use strictures 1;
-use Test::Exception;
+use Test::Fatal;
BEGIN { require "t/moo-accessors.t"; }
requires 'gun_dog';
}
-lives_ok {
+is exception {
Moose::Util::apply_all_roles($meta, 'MooRequiresFour');
-} 'apply role with satisified requirement';
+}, undef, 'apply role with satisified requirement';
-dies_ok {
+ok exception {
Moose::Util::apply_all_roles($meta, 'MooRequiresGunDog');
-} 'apply role with unsatisified requirement';
+}, 'apply role with unsatisified requirement';
done_testing;
use strictures 1;
use Test::More;
-use Test::Exception;
-
-use Moo::HandleMoose;
+use Test::Fatal;
{
package FrewWithIsa;
__PACKAGE__->meta->make_immutable;
}
-lives_ok {
+is(exception {
Bar->new(frooh => 1, frew => 1);
-} 'creation of valid Bar';
+}, undef, 'creation of valid Bar');
-dies_ok {
+ok exception {
Bar->new(frooh => 'silly', frew => 1);
-} 'creation of invalid Bar validated by coderef';
+}, 'creation of invalid Bar validated by coderef';
-dies_ok {
+ok exception {
Bar->new(frooh => 1, frew => 'goose');
-} 'creation of invalid Bar validated by quoted sub';
+}, 'creation of invalid Bar validated by quoted sub';
sub test_off_by_one {
my ($class, $type) = @_;
use strictures 1;
use Test::More;
-use Test::Exception;
-
-use Moo::HandleMoose;
+use Test::Fatal;
{
package MooParentRole;
for my $parent (qw(MooseParent MooParent)) {
for my $child (qw(MooRoledMooClass MooRoledMooseClass)) {
- lives_and {
+ is(exception {
my $o = $parent->new(
e => $child->new(),
);
can_ok( $o->e, "parent_role_method" );
ok($o->e->meta->has_method('role_method'), 'Moose knows about role_method');
ok($o->e->meta->has_method('parent_role_method'), 'Moose knows about parent_role_method');
- };
+ }, undef);
}
}
use strictures 1;
use Test::More;
-use Test::Exception;
-
-use Moo::HandleMoose;
{
package LazyFrew;