Add test for load_class on stashes with GVs without actual methods.
Florian Ragwitz [Mon, 9 Mar 2009 22:02:10 +0000 (23:02 +0100)]
t/085_load_class_gvstash_detect_bug.t [new file with mode: 0644]

diff --git a/t/085_load_class_gvstash_detect_bug.t b/t/085_load_class_gvstash_detect_bug.t
new file mode 100644 (file)
index 0000000..a3461bf
--- /dev/null
@@ -0,0 +1,21 @@
+use strict;
+use warnings;
+use Test::More tests => 3;
+use Test::Exception;
+
+use Class::MOP;
+use lib 't/lib';
+
+lives_ok {
+    Class::MOP::load_class('TestClassLoaded::Sub');
+};
+
+TestClassLoaded->can('a_method');
+
+lives_ok {
+    Class::MOP::load_class('TestClassLoaded');
+};
+
+lives_ok {
+    TestClassLoaded->a_method;
+}