6 use Test::More tests => 6; #7;
20 bless { no_moose => "Elk" } => $class;
23 sub no_moose { $_[0]->{no_moose} }
30 has 'moose' => (is => 'ro', default => 'Foo');
34 my $super = $class->SUPER::new(@_);
35 return $class->meta->new_object('__INSTANCE__' => $super, @_);
38 make_immutable(debug => 0);
41 use metaclass 'Class::MOP::Class';
43 __PACKAGE__->meta->add_attribute('squeegee' => (accessor => 'squeegee'));
45 package Old::Bucket::Nose;
46 # see http://www.moosefoundation.org/moose_facts.htm
55 package Custom::Meta1;
56 use base qw(Moose::Meta::Class);
58 package Custom::Meta2;
59 use base qw(Moose::Meta::Class);
62 use metaclass 'Custom::Meta1';
68 use metaclass 'Custom::Meta2';
71 # XXX FIXME subclassing meta-attrs and immutable-ing the subclass fails
74 my $foo_moose = Foo::Moose->new();
75 isa_ok($foo_moose, 'Foo::Moose');
76 isa_ok($foo_moose, 'Elk');
78 is($foo_moose->no_moose, 'Elk', '... got the right value from the Elk method');
79 is($foo_moose->moose, 'Foo', '... got the right value from the Foo::Moose method');
82 # Old::Bucket::Nose->meta->make_immutable(debug => 0);
83 #} 'Immutability on Moose class extending Class::MOP class ok';
86 SubClass2::extends('MyBase');
87 } 'Can subclass the same non-Moose class twice with different metaclasses';