9 'Algorithm::C3' => '0.01', # skip all if not installed
13 require_ok(File::Spec->catfile('examples', 'C3MethodDispatchOrder.pod'));
18 use metaclass 'C3MethodDispatchOrder';
20 sub hello { 'Diamond_A::hello' }
23 use metaclass 'C3MethodDispatchOrder';
24 __PACKAGE__->meta->superclasses('Diamond_A');
27 use metaclass 'C3MethodDispatchOrder';
28 __PACKAGE__->meta->superclasses('Diamond_A');
30 sub hello { 'Diamond_C::hello' }
33 use metaclass 'C3MethodDispatchOrder';
34 __PACKAGE__->meta->superclasses('Diamond_B', 'Diamond_C');
38 [ Diamond_D->meta->class_precedence_list ],
39 [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ],
40 '... got the right MRO for Diamond_D');
42 is(Diamond_D->hello, 'Diamond_C::hello', '... got the right dispatch order');
43 is(Diamond_D->can('hello')->(), 'Diamond_C::hello', '... can(method) resolved itself as expected');