6 use Test::More tests => 6;
18 bless { no_moose => "Elk" } => $class;
21 sub no_moose { $_[0]->{no_moose} }
28 has 'moose' => (is => 'ro', default => 'Foo');
32 my $super = $class->SUPER::new(@_);
33 return $class->meta->new_object('__INSTANCE__' => $super, @_);
36 __PACKAGE__->meta->make_immutable(debug => 0);
39 use metaclass 'Class::MOP::Class';
41 __PACKAGE__->meta->add_attribute('squeegee' => (accessor => 'squeegee'));
43 package Old::Bucket::Nose;
44 # see http://www.moosefoundation.org/moose_facts.htm
52 package Custom::Meta1;
53 use base qw(Moose::Meta::Class);
55 package Custom::Meta2;
56 use base qw(Moose::Meta::Class);
59 use metaclass 'Custom::Meta1';
65 use metaclass 'Custom::Meta2';
68 # XXX FIXME subclassing meta-attrs and immutable-ing the subclass fails
71 my $foo_moose = Foo::Moose->new();
72 isa_ok($foo_moose, 'Foo::Moose');
73 isa_ok($foo_moose, 'Elk');
75 is($foo_moose->no_moose, 'Elk', '... got the right value from the Elk method');
76 is($foo_moose->moose, 'Foo', '... got the right value from the Foo::Moose method');
79 Old::Bucket::Nose->meta->make_immutable(debug => 0);
80 } 'Immutability on Moose class extending Class::MOP class ok';
83 SubClass2->meta->superclasses([ 'MyBase' ]);
84 } 'Can subclass the same non-Moose class twice with different metaclasses';