reverting (most of) the whitespace changes
[catagits/Catalyst-Runtime.git] / t / c3_mro.t
CommitLineData
b4664174 1use strict;
2use warnings;
3
4use Test::More;
5require Catalyst;
6require Module::Pluggable::Object;
7
8eval "require Class::C3";
9plan skip_all => "This test requires Class::C3" if $@;
10
11# Get a list of all Catalyst:: packages in blib via M::P::O
12my @cat_mods;
13{
14 local @INC = grep {/blib/} @INC;
15 @cat_mods = (
ac5c933b 16 'Catalyst',
b4664174 17 Module::Pluggable::Object->new(search_path => ['Catalyst'])->plugins,
18 );
19}
20
21# plan one test per found package name
22plan tests => scalar @cat_mods;
23
24# Try to calculate the C3 MRO for each package
25#
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.
30#
31foreach my $cat_mod (@cat_mods) {
32 eval " require $cat_mod ";
33 eval { Class::C3::calculateMRO($cat_mod) };
4ae6f108 34 ok(!$@, "calculateMRO for $cat_mod: $@");
b4664174 35}
36