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 # problem with @INC on win32, see:
15 # http://rt.cpan.org/Ticket/Display.html?id=26452
16 if ($^O eq 'MSWin32') { require Win32; Win32::GetCwd(); }
18 local @INC = grep {/blib/} @INC;
21 Module::Pluggable::Object->new(search_path => ['Catalyst'])->plugins,
25 # plan one test per found package name
26 plan tests => scalar @cat_mods;
28 # Try to calculate the C3 MRO for each package
30 # In the case that the initial require fails (as in
31 # Catalyst::Engine::FastCGI when FCGI is not installed),
32 # the calculateMRO eval will not error out, which is
33 # effectively a test skip.
35 foreach my $cat_mod (@cat_mods) {
36 eval " require $cat_mod ";
37 eval { Class::C3::calculateMRO($cat_mod) };
38 ok(!$@, "calculateMRO for $cat_mod: $@");