3 BEGIN { require "t/moo-accessors.t"; }
7 my $meta = Class::MOP::get_metaclass_by_name('Foo');
11 ok($attr = $meta->get_attribute('one'), 'Meta-attribute exists');
12 is($attr->get_read_method, 'one', 'Method name');
13 is($attr->get_read_method_ref->body, Foo->can('one'), 'Right method');
15 is(Foo->new(one => 1, THREE => 3)->one, 1, 'Accessor still works');
17 $meta = Moose::Meta::Class->initialize('Spoon');
19 $meta->superclasses('Moose::Object');
21 Moose::Util::apply_all_roles($meta, 'Bar');
23 my $spoon = Spoon->new(four => 4);
25 is($spoon->four, 4, 'Role application ok');