Convert all tests to done_testing.
[gitmo/Class-MOP.git] / t / 083_load_class.t
index fb802bf..67553be 100644 (file)
@@ -1,12 +1,15 @@
 use strict;
 use warnings;
-use Test::More tests => 32;
+use Test::More;
 use Test::Exception;
 
 require Class::MOP;
 use lib 't/lib';
 
-ok(!Class::MOP::is_class_loaded(), "is_class_loaded with no argument returns false");
+dies_ok {
+    Class::MOP::is_class_loaded()
+} "is_class_loaded with no argument dies";
+
 ok(!Class::MOP::is_class_loaded(''), "can't load the empty class");
 ok(!Class::MOP::is_class_loaded(\"foo"), "can't load a class name reference??");
 
@@ -62,8 +65,8 @@ qr/Missing right curly/,
 throws_ok {
     Class::MOP::load_class('This::Does::Not::Exist');
 }
-qr/Could not load class \(This::Does::Not::Exist\) because :/,
-    'Many Moose tests rely on the exact formatting of this error';
+qr{Can't locate This/Does/Not/Exist\.pm in \@INC},
+    'load_first_existing_class throws a familiar error for a single module';
 
 {
     package Other;
@@ -87,7 +90,7 @@ lives_ok {
 
 throws_ok {
     Class::MOP::load_first_existing_class("Does::Not::Exist", "Also::Does::Not::Exist")
-} qr/Could not load class \(Does::Not::Exist.*Could not load class \(Also::Does::Not::Exist/s, 'Multiple non-existant classes cause exception';
+} qr/Does::Not::Exist.*Also::Does::Not::Exist/s, 'Multiple non-existant classes cause exception';
 
 {
     sub whatever {
@@ -142,3 +145,4 @@ throws_ok {
         'an @ISA with members does mean a class is loaded' );
 }
 
+done_testing;