use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More;
-BEGIN {
- use_ok('Class::C3');
+BEGIN {
+ eval "use NEXT";
+ plan skip_all => "NEXT required for this test" if $@;
+ plan tests => 4;
}
{
package Baz;
use strict;
use warnings;
- use NEXT;
+ require NEXT; # load this as late as possible so we can catch the test skip
use base 'Bar', 'Fuz';
sub foo { 'Baz::foo => ' . (shift)->NEXT::foo }
}
+Class::C3::initialize();
+
is(Foo->foo, 'Foo::foo', '... got the right value from Foo->foo');
is(Fuz->foo, 'Fuz::foo => Foo::foo', '... got the right value from Fuz->foo');
is(Bar->foo, 'Bar::foo => Foo::foo', '... got the right value from Bar->foo');