Revert most of the conversion to Test::Fatal so we can redo it
[gitmo/Moose.git] / t / 050_metaclasses / 013_metaclass_traits.t
index 7823237..b47cea4 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use lib 't/lib', 'lib';
 
 use Test::More;
-use Test::Fatal;
+use Test::Exception;
 
 {
     package My::SimpleTrait;
@@ -167,10 +167,9 @@ is( Role::Foo->meta()->simple(), 5,
 
 {
     require Moose::Util::TypeConstraints;
-    my $error;
-    ok($error = exception { Moose::Util::TypeConstraints->import( -traits => 'My::SimpleTrait' ) },
-             'cannot provide -traits to an exporting module that does not init_meta');
-    like( $error, qr/does not have an init_meta/,
+    dies_ok( sub { Moose::Util::TypeConstraints->import( -traits => 'My::SimpleTrait' ) },
+             'cannot provide -traits to an exporting module that does not init_meta' );
+    like( $@, qr/does not have an init_meta/,
           '... and error provides a useful explanation' );
 }
 
@@ -199,10 +198,10 @@ is( Foo::Subclass->meta()->attr2(), 'something',
     has an_attr => ( is => 'ro' );
 }
 
-ok ! exception {
+lives_ok {
     my $instance = Class::WithAlreadyPresentTrait->new( an_attr => 'value' );
     is( $instance->an_attr, 'value', 'Can get value' );
-},
+}
 'Can create instance and access attributes';
 
 {
@@ -216,10 +215,10 @@ ok ! exception {
     has an_attr => ( is => 'ro' );
 }
 
-ok ! exception {
+lives_ok {
     my $instance = Class::WhichLoadsATraitFromDisk->new( an_attr => 'value' );
     is( $instance->an_attr, 'value', 'Can get value' );
-},
+}
 'Can create instance and access attributes';
 
 done_testing;