4 use Test::More tests => 6;
23 my ($self, @args) = @_;
24 $self->meta->clone_object($self, @args);
28 my $foo = Foo->new(bar => [ 1, 2, 3 ]);
30 is($foo->foo, "foo", "attr 1",);
31 is_deeply($foo->bar, [ 1 .. 3 ], "attr 2");
33 my $clone = $foo->clone(foo => "dancing");
35 is($clone->foo, "dancing", "overridden attr");
36 is_deeply($clone->bar, [ 1 .. 3 ], "clone attr");
39 Foo->meta->clone_object("constant");
40 } qr/You must pass an instance of the metaclass \(Foo\), not \(constant\)/;
43 Foo->meta->clone_object(Foo->meta)
44 } qr/You must pass an instance of the metaclass \(Foo\), not \(Mo.se::Meta::Class=HASH\(\w+\)\)/;