6 use Test::More tests => 16;
15 sub foo { 'Foo::foo' }
16 sub bar { 'Foo::bar' }
17 sub baz { 'Foo::baz' }
24 override bar => sub { 'Bar::bar -> ' . super() };
31 override bar => sub { 'Baz::bar -> ' . super() };
32 override baz => sub { 'Baz::baz -> ' . super() };
34 no Moose; # ensure super() still works after unimport
42 is($baz->foo(), 'Foo::foo', '... got the right value from &foo');
43 is($baz->bar(), 'Baz::bar -> Bar::bar -> Foo::bar', '... got the right value from &bar');
44 is($baz->baz(), 'Baz::baz -> Foo::baz', '... got the right value from &baz');
50 is($bar->foo(), 'Foo::foo', '... got the right value from &foo');
51 is($bar->bar(), 'Bar::bar -> Foo::bar', '... got the right value from &bar');
52 is($bar->baz(), 'Foo::baz', '... got the right value from &baz');
57 is($foo->foo(), 'Foo::foo', '... got the right value from &foo');
58 is($foo->bar(), 'Foo::bar', '... got the right value from &bar');
59 is($foo->baz(), 'Foo::baz', '... got the right value from &baz');
67 sub bling { 'Bling::bling' }
74 sub bling { 'Bling::bling' }
77 override 'bling' => sub {};
78 } '... cannot override a method which has a local equivalent';