Revert most of the conversion to Test::Fatal so we can redo it
[gitmo/Moose.git] / t / 050_metaclasses / 012_moose_exporter.t
index f00e9a8..e37669d 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 
 use Test::More;
-use Test::Fatal;
+use Test::Exception;
 
 use Test::Requires {
     'Test::Output' => '0.01', # skip all if not installed
@@ -197,9 +197,8 @@ use Test::Requires {
 
     use Moose ();
 
-    my $error;
-    ::ok($error = ::exception
-        {
+    ::dies_ok(
+        sub {
             Moose::Exporter->setup_import_methods(
                 also => [ 'Moose', 'MooseX::CircularAlso' ],
             );
@@ -208,7 +207,7 @@ use Test::Requires {
     );
 
     ::like(
-        $error,
+        $@,
         qr/\QCircular reference in 'also' parameter to Moose::Exporter between MooseX::CircularAlso and MooseX::CircularAlso/,
         'got the expected error from circular reference in also'
     );
@@ -219,9 +218,8 @@ use Test::Requires {
 
     use Moose ();
 
-    my $error;
-    ::ok($error = ::exception
-        {
+    ::dies_ok(
+        sub {
             Moose::Exporter->setup_import_methods(
                 also => [ 'NoSuchThing' ],
             );
@@ -230,7 +228,7 @@ use Test::Requires {
     );
 
     ::like(
-        $error,
+        $@,
         qr/\QPackage in also (NoSuchThing) does not seem to use Moose::Exporter (is it loaded?) at /,
         'got the expected error from a reference in also to a package which is not loaded'
     );
@@ -241,9 +239,8 @@ use Test::Requires {
 
     use Moose ();
 
-    my $error;
-    ::ok($error = ::exception
-        {
+    ::dies_ok(
+        sub {
             Moose::Exporter->setup_import_methods(
                 also => [ 'Moose::Meta::Method' ],
             );
@@ -252,7 +249,7 @@ use Test::Requires {
     );
 
     ::like(
-        $error,
+        $@,
         qr/\QPackage in also (Moose::Meta::Method) does not seem to use Moose::Exporter at /,
         'got the expected error from a reference in also to a package which does not use Moose::Exporter'
     );