6 use Test::More tests => 17;
17 sub foo { 'Foo::foo' }
18 sub bar { 'Foo::bar' }
19 sub baz { 'Foo::baz' }
26 override bar => sub { 'Bar::bar -> ' . super() };
33 override bar => sub { 'Baz::bar -> ' . super() };
34 override baz => sub { 'Baz::baz -> ' . super() };
36 no Moose; # ensure super() still works after unimport
44 is($baz->foo(), 'Foo::foo', '... got the right value from &foo');
45 is($baz->bar(), 'Baz::bar -> Bar::bar -> Foo::bar', '... got the right value from &bar');
46 is($baz->baz(), 'Baz::baz -> Foo::baz', '... got the right value from &baz');
52 is($bar->foo(), 'Foo::foo', '... got the right value from &foo');
53 is($bar->bar(), 'Bar::bar -> Foo::bar', '... got the right value from &bar');
54 is($bar->baz(), 'Foo::baz', '... got the right value from &baz');
59 is($foo->foo(), 'Foo::foo', '... got the right value from &foo');
60 is($foo->bar(), 'Foo::bar', '... got the right value from &bar');
61 is($foo->baz(), 'Foo::baz', '... got the right value from &baz');
69 sub bling { 'Bling::bling' }
76 sub bling { 'Bling::bling' }
79 override 'bling' => sub {};
80 } '... cannot override a method which has a local equivalent';