Class::MOP - lots of knot tying, this should make subclassing more reliable and strai...
[gitmo/Class-MOP.git] / t / 010_self_introspection.t
index 314afe3..ebb51cd 100644 (file)
@@ -7,6 +7,7 @@ use Test::More no_plan => 1;
 use Test::Exception;
 
 BEGIN {
+    use_ok('Class::MOP');
     use_ok('Class::MOP::Class');        
 }
 
@@ -46,6 +47,13 @@ foreach my $non_method_name (qw(
     ok(!$meta->has_method($non_method_name), '... NOT Class::MOP::Class->has_method(' . $non_method_name . ')');        
 }
 
+foreach my $attribute_name (
+    '$:pkg', '%:attrs'
+    ) {
+    ok($meta->has_attribute($attribute_name), '... Class::MOP::Class->has_attribute(' . $attribute_name . ')');        
+    isa_ok($meta->get_attribute($attribute_name), 'Class::MOP::Attribute');            
+}
+
 is($meta->name, 'Class::MOP::Class', '... Class::MOP::Class->name');
 is($meta->version, $Class::MOP::Class::VERSION, '... Class::MOP::Class->version');