Test uri_for with path = 0
[catagits/Catalyst-Runtime.git] / t / aggregate / c3_mro.t
CommitLineData
b4664174 1use strict;
2use warnings;
3
4use Test::More;
5require Catalyst;
6require Module::Pluggable::Object;
951bab6b 7use MRO::Compat;
b4664174 8
9# Get a list of all Catalyst:: packages in blib via M::P::O
10my @cat_mods;
11{
2f381252 12 # problem with @INC on win32, see:
13 # http://rt.cpan.org/Ticket/Display.html?id=26452
14 if ($^O eq 'MSWin32') { require Win32; Win32::GetCwd(); }
15
b4664174 16 local @INC = grep {/blib/} @INC;
17 @cat_mods = (
737a1e42 18 'Catalyst',
b4664174 19 Module::Pluggable::Object->new(search_path => ['Catalyst'])->plugins,
20 );
21}
22
23# plan one test per found package name
24plan tests => scalar @cat_mods;
25
26# Try to calculate the C3 MRO for each package
27#
28# In the case that the initial require fails (as in
29# Catalyst::Engine::FastCGI when FCGI is not installed),
30# the calculateMRO eval will not error out, which is
31# effectively a test skip.
32#
33foreach my $cat_mod (@cat_mods) {
34 eval " require $cat_mod ";
951bab6b 35 eval { mro::get_linear_isa($cat_mod, 'c3') };
4ae6f108 36 ok(!$@, "calculateMRO for $cat_mod: $@");
b4664174 37}
38