NEXT/next::method thing needed updated for removal of the c3 assumption in next:...
[gitmo/Class-C3.git] / t / 33_next_method_used_with_NEXT.t
index 6547165..c0ed1e1 100644 (file)
@@ -3,10 +3,12 @@
 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;
 }
 
 {
@@ -36,13 +38,16 @@ BEGIN {
     package Baz;
     use strict;
     use warnings;    
-    use NEXT;
+    use Class::C3;
+    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');