Commit | Line | Data |
b4664174 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | require Catalyst; |
6 | require Module::Pluggable::Object; |
951bab6b |
7 | use MRO::Compat; |
b4664174 |
8 | |
9 | # Get a list of all Catalyst:: packages in blib via M::P::O |
10 | my @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 = ( |
ac5c933b |
18 | 'Catalyst', |
b4664174 |
19 | Module::Pluggable::Object->new(search_path => ['Catalyst'])->plugins, |
20 | ); |
21 | } |
22 | |
23 | # plan one test per found package name |
24 | plan 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 | # |
33 | foreach 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 | |