basic implementation of preserving attrs/methods across reinitialization
[gitmo/Class-MOP.git] / t / 049_metaclass_reinitialize.t
index 43815b0..423a49c 100644 (file)
@@ -1,13 +1,14 @@
 use strict;
 use warnings;
 
-use Test::More tests => 14;
+use Test::More;
 use Test::Exception;
 
 {
     package Foo;
     use metaclass;
     sub foo {}
+    Foo->meta->add_attribute('bar');
 }
 
 sub check_meta_sanity {
@@ -15,6 +16,7 @@ sub check_meta_sanity {
     isa_ok($meta, 'Class::MOP::Class');
     is($meta->name, 'Foo');
     ok($meta->has_method('foo'));
+    ok($meta->has_attribute('bar'));
 }
 
 can_ok('Foo', 'meta');
@@ -39,3 +41,5 @@ throws_ok {
 throws_ok {
     $meta->reinitialize($meta->new_object);
 } qr/You must pass a package name or an existing Class::MOP::Package instance/;
+
+done_testing;