use inlined module hiding in tests
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_engineloader.t
1 use strict;
2 use warnings;
3 use Test::More;
4 use Catalyst::EngineLoader;
5
6 my $cases = {
7     FastCGI => {
8         expected_catalyst_engine_class => 'Catalyst::Engine',
9         ENV => { CATALYST_ENGINE => 'FastCGI' },
10     },
11     CGI => {
12         expected_catalyst_engine_class => 'Catalyst::Engine',
13         ENV => { CATALYST_ENGINE => 'CGI' },
14     },
15     Apache1 => {
16         expected_catalyst_engine_class => 'Catalyst::Engine',
17         ENV => { CATALYST_ENGINE => 'Apache1' },
18     },
19 };
20
21 foreach my $name (keys %$cases) {
22     local %ENV = %{ $cases->{$name}->{ENV} };
23     my $loader = Catalyst::EngineLoader->new(application_name => "TestApp");
24     if (my $expected = $cases->{$name}->{expected_catalyst_engine_class}) {
25         is $loader->catalyst_engine_class, $expected, $name . " catalyst_engine_class";
26     }
27 }
28
29 done_testing;