test for throwing when a class is empty or nonexistent in a loaded file
Robert Buels [Wed, 10 Feb 2010 23:33:11 +0000 (15:33 -0800)]
t/083_load_class.t
t/lib/MistypedPackageName.pm [new file with mode: 0644]

index 67553be..2a11077 100644 (file)
@@ -145,4 +145,13 @@ throws_ok {
         'an @ISA with members does mean a class is loaded' );
 }
 
+{
+
+    throws_ok {
+       Class::MOP::load_class("MistypedPackageName")
+    } qr/empty/, 'throws for nonexistent package name with something in a sub-namespace';
+
+}
+
+
 done_testing;
diff --git a/t/lib/MistypedPackageName.pm b/t/lib/MistypedPackageName.pm
new file mode 100644 (file)
index 0000000..26a235d
--- /dev/null
@@ -0,0 +1,7 @@
+package MistypedPackageName_Oops_I_Mistyped_it;
+use Moose;
+
+package MistypedPackageName::SubNamespace;
+use Moose;
+1;
+