Redo conversion to Test::Fatal
[gitmo/Class-MOP.git] / t / 315_magic.t
index d17dff0..1969253 100755 (executable)
@@ -4,8 +4,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 9;
-use Test::Exception;
+use Test::More;
+use Test::Fatal;
 
 use Class::MOP;
 
@@ -15,14 +15,14 @@ use Tie::Scalar;
     package Foo;
     use metaclass;
 
-    Foo->meta->add_attribute('bar' => 
+    Foo->meta->add_attribute('bar' =>
         reader => 'get_bar',
         writer => 'set_bar',
-    );  
+    );
 
-    Foo->meta->add_attribute('baz' => 
+    Foo->meta->add_attribute('baz' =>
         accessor => 'baz',
-    );  
+    );
 
     Foo->meta->make_immutable();
 }
@@ -55,19 +55,21 @@ use Tie::Scalar;
 {
     my $x = tie my $value, 'Tie::StdScalar', 'Class::MOP';
 
-    lives_ok{ Class::MOP::load_class($value) } 'load_class(tied scalar)';
+    is( exception { Class::MOP::load_class($value) }, undef, 'load_class(tied scalar)' );
 
     $value = undef;
     $x->STORE('Class::MOP'); # reset
 
-    lives_and{
+    is( exception {
         ok Class::MOP::is_class_loaded($value);
-    } 'is_class_loaded(tied scalar)';
+    }, undef, 'is_class_loaded(tied scalar)' );
 
     $value = undef;
     $x->STORE(\&Class::MOP::get_code_info); # reset
 
-    lives_and{
+    is( exception {
         is_deeply [Class::MOP::get_code_info($value)], [qw(Class::MOP get_code_info)], 'get_code_info(tied scalar)';
-    }
+    }, undef );
 }
+
+done_testing;