use strict;
use warnings;
-use Test::More tests => 29;
+use Test::More tests => 36;
use Test::Exception;
BEGIN {
is($my_meta->new_object(':package' => 'Baz'), $baz_meta, '... got the right Baz->meta singleton');
is($my_meta->clone_object($baz_meta), $baz_meta, '... cloning got the right Baz->meta singleton');
+$baz_meta->superclasses('Bar');
+
# now create a regular objects for real
my $foo = $foo_meta->new_object();
isa_ok($bar, 'Bar');
isa_ok($bar, 'Foo');
+my $baz = $baz_meta->new_object();
+isa_ok($baz, 'Baz');
+isa_ok($baz, 'Bar');
+isa_ok($baz, 'Foo');
+
my $cloned_foo = $foo_meta->clone_object($foo);
isa_ok($cloned_foo, 'Foo');
$foo_meta->clone_object($meta);
} '... this dies as expected';
+# test stuff
+
+{
+ package FooBar;
+ use metaclass;
+
+ FooBar->meta->add_attribute('test');
+}
+
+my $attr = FooBar->meta->get_attribute('test');
+isa_ok($attr, 'Class::MOP::Attribute');
+
+my $attr_clone = $attr->clone();
+isa_ok($attr_clone, 'Class::MOP::Attribute');
+
+isnt($attr, $attr_clone, '... we successfully cloned our attributes');
+is($attr->associated_class,
+ $attr_clone->associated_class,
+ '... we successfully did not clone our associated metaclass');
+