6 use Test::More tests => 6;
19 bless { no_moose => "Elk" } => $class;
22 sub no_moose { $_[0]->{no_moose} }
29 has 'moose' => ( is => 'ro', default => 'Foo' );
33 my $super = $class->SUPER::new(@_);
34 return $class->meta->new_object( '__INSTANCE__' => $super, @_ );
37 __PACKAGE__->meta->make_immutable( inline_constructor => 0, debug => 0 );
40 use metaclass 'Class::MOP::Class';
42 __PACKAGE__->meta->add_attribute(
43 'squeegee' => ( accessor => 'squeegee' ) );
45 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
47 package Old::Bucket::Nose;
49 # see http://www.moosefoundation.org/moose_facts.htm
57 package Custom::Meta1;
58 use base qw(Moose::Meta::Class);
60 package Custom::Meta2;
61 use base qw(Moose::Meta::Class);
64 use metaclass 'Custom::Meta1';
70 use metaclass 'Custom::Meta2';
73 # XXX FIXME subclassing meta-attrs and immutable-ing the subclass fails
76 my $foo_moose = Foo::Moose->new();
77 isa_ok( $foo_moose, 'Foo::Moose' );
78 isa_ok( $foo_moose, 'Elk' );
80 is( $foo_moose->no_moose, 'Elk',
81 '... got the right value from the Elk method' );
82 is( $foo_moose->moose, 'Foo',
83 '... got the right value from the Foo::Moose method' );
86 Old::Bucket::Nose->meta->make_immutable( debug => 0 );
88 'Immutability on Moose class extending Class::MOP class ok';
91 SubClass2->meta->superclasses('MyBase');
93 'Can subclass the same non-Moose class twice with different metaclasses';