From: Florian Ragwitz Date: Sun, 25 Oct 2009 00:14:31 +0000 (-0700) Subject: Make is_class_loaded without args fail loudly. X-Git-Tag: 0.95~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bd0ad27829f196b3f382ea2149baeb9af38aae40;p=gitmo%2FClass-MOP.git Make is_class_loaded without args fail loudly. --- diff --git a/Changes b/Changes index 80b76f4..df7830f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Perl extension Class-MOP. + * Class::MOP + - Make is_class_loaded without any arguments fail loudly + (Florian Ragwitz). + * Class::MOP::Class * Class::MOP::Package - Any method which takes a method name as an argument now allows names diff --git a/t/083_load_class.t b/t/083_load_class.t index e990351..c4569c5 100644 --- a/t/083_load_class.t +++ b/t/083_load_class.t @@ -6,7 +6,10 @@ 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??"); diff --git a/xs/MOP.xs b/xs/MOP.xs index f7aeb69..e1a5ac7 100644 --- a/xs/MOP.xs +++ b/xs/MOP.xs @@ -51,7 +51,7 @@ get_code_info(coderef) } void -is_class_loaded(klass=&PL_sv_undef) +is_class_loaded(klass) SV *klass PREINIT: HV *stash;