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( inline_constructor => 0, debug => 0 );
39 use metaclass 'Class::MOP::Class';
41 __PACKAGE__->meta->add_attribute(
42 'squeegee' => ( accessor => 'squeegee' ) );
44 package Old::Bucket::Nose;
46 # see http://www.moosefoundation.org/moose_facts.htm
54 package Custom::Meta1;
55 use base qw(Moose::Meta::Class);
57 package Custom::Meta2;
58 use base qw(Moose::Meta::Class);
61 use metaclass 'Custom::Meta1';
67 use metaclass 'Custom::Meta2';
70 # XXX FIXME subclassing meta-attrs and immutable-ing the subclass fails
73 my $foo_moose = Foo::Moose->new();
74 isa_ok( $foo_moose, 'Foo::Moose' );
75 isa_ok( $foo_moose, 'Elk' );
77 is( $foo_moose->no_moose, 'Elk',
78 '... got the right value from the Elk method' );
79 is( $foo_moose->moose, 'Foo',
80 '... got the right value from the Foo::Moose method' );
83 Old::Bucket::Nose->meta->make_immutable( debug => 0 );
84 }, undef, 'Immutability on Moose class extending Class::MOP class ok' );
87 SubClass2->meta->superclasses('MyBase');
88 }, undef, 'Can subclass the same non-Moose class twice with different metaclasses' );