be a bit more anal about the checking for successful load
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Utils.pm
index ed40b02..ac20a70 100644 (file)
@@ -229,7 +229,12 @@ sub ensure_class_loaded {
         eval "require $class";
         $error = $@;
     }
+
     die $error if $error;
+    die "require $class was successful but the package is not defined"
+        unless Class::Inspector->loaded($class);
+
+    return 1;
 }