From: Robert Buels Date: Wed, 10 Feb 2010 23:33:11 +0000 (-0800) Subject: test for throwing when a class is empty or nonexistent in a loaded file X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=344180043c111503ff74fb13e5c5741771641d36;p=gitmo%2FClass-MOP.git test for throwing when a class is empty or nonexistent in a loaded file --- diff --git a/t/083_load_class.t b/t/083_load_class.t index 67553be..2a11077 100644 --- a/t/083_load_class.t +++ b/t/083_load_class.t @@ -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 index 0000000..26a235d --- /dev/null +++ b/t/lib/MistypedPackageName.pm @@ -0,0 +1,7 @@ +package MistypedPackageName_Oops_I_Mistyped_it; +use Moose; + +package MistypedPackageName::SubNamespace; +use Moose; +1; +