From: Graham Knop Date: Fri, 29 Jul 2016 13:32:56 +0000 (-0400) Subject: remove direct use of Class::C3 in tests X-Git-Tag: v1.001_001~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=374af1a534af73fc7e04940b6130db797aebb0de;p=p5sagit%2FClass-C3-Componentised.git remove direct use of Class::C3 in tests --- diff --git a/Makefile.PL b/Makefile.PL index 585041b..338ce6b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -17,10 +17,6 @@ requires 'Class::Inspector' => '1.23'; # isn't needed. However, some existing code relies on us loading Class::C3. We # don't want to break it just yet. Therefore we depend directly on Class::C3 as # well. - -### !!! IMPORTANT !!! ### -# tests currently rely on Class::C3 availability, by requiring it directly -# will need adjustment if the require is removed requires 'Class::C3' => '0.20'; resources repository => 'git://git.shadowcat.co.uk/p5sagit/Class-C3-Componentised.git'; diff --git a/t/01-basic.t b/t/01-basic.t index d4603d0..8bc81fd 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -96,7 +96,7 @@ like( $@, qr/Invalid class name 'ENDS::WITH::COLONS::'/, 'Throw on Class::' ); ok( $retval, 'PAR package "loaded"' ); # see if we can still load stuff with the coderef present - $retval = eval { MyModule->load_optional_class('Class::C3') }; + $retval = eval { MyModule->load_optional_class('AnotherModule') }; ok( !$@, 'load_optional_class did not throw' ) || diag $@; - ok( $retval, 'Class::C3 loaded' ); + ok( $retval, 'AnotherModule loaded' ); } diff --git a/t/lib/AnotherModule.pm b/t/lib/AnotherModule.pm new file mode 100644 index 0000000..841ff5f --- /dev/null +++ b/t/lib/AnotherModule.pm @@ -0,0 +1,2 @@ +package AnotherModule; +1; diff --git a/t/lib/MyModule/OwnComponent.pm b/t/lib/MyModule/OwnComponent.pm index 56cff2b..b89b5fe 100644 --- a/t/lib/MyModule/OwnComponent.pm +++ b/t/lib/MyModule/OwnComponent.pm @@ -1,7 +1,8 @@ package # hide from pause MyModule::OwnComponent; -use Class::C3; +use MRO::Compat; +use mro 'c3'; sub message { my $self = shift; diff --git a/t/lib/MyModule/Plugin/Foo.pm b/t/lib/MyModule/Plugin/Foo.pm index 77f990c..0f12956 100644 --- a/t/lib/MyModule/Plugin/Foo.pm +++ b/t/lib/MyModule/Plugin/Foo.pm @@ -1,7 +1,8 @@ package # hide from pause MyModule::Plugin::Foo; -use Class::C3; +use MRO::Compat; +use mro 'c3'; sub message { "Foo";