6 require Module::Pluggable::Object;
8 eval "require Class::C3";
9 plan skip_all => "This test requires Class::C3" if $@;
11 # Get a list of all Catalyst:: packages in blib via M::P::O
14 local @INC = grep {/blib/} @INC;
17 Module::Pluggable::Object->new(search_path => ['Catalyst'])->plugins,
21 # plan one test per found package name
22 plan tests => scalar @cat_mods;
24 # Try to calculate the C3 MRO for each package
26 # In the case that the initial require fails (as in
27 # Catalyst::Engine::FastCGI when FCGI is not installed),
28 # the calculateMRO eval will not error out, which is
29 # effectively a test skip.
31 foreach my $cat_mod (@cat_mods) {
32 eval " require $cat_mod ";
33 eval { Class::C3::calculateMRO($cat_mod) };
34 ok(!$@, "calculateMRO for $cat_mod");