remove unnecessary Path::Class dep from test
[catagits/Catalyst-Plugin-ConfigLoader.git] / t / 10-live_auto.t
CommitLineData
a7afecf7 1use strict;
2use warnings;
3
4use FindBin;
5use lib "$FindBin::Bin/lib";
6
3af1b75e 7use Test::More tests => 5;
a7afecf7 8
1818b6bc 9BEGIN {
10 # Remove all relevant env variables to avoid accidental fail
11 foreach my $name ( grep { m{^(CATALYST)} } keys %ENV ) {
12 delete $ENV{ $name };
13 }
14}
15
a7afecf7 16use Catalyst::Test 'TestApp';
17
18{
19 my $response;
587d381b 20 ok( $response = request( 'http://localhost/config/' ), 'request ok' );
a7afecf7 21 is( $response->content, 'foo', 'config ok' );
22
587d381b 23 $response = request( 'http://localhost/appconfig/cache' );
24 ok( $response->content !~ /^__HOME__/,
25 'home dir substituted in config var'
26 );
a7afecf7 27
587d381b 28 $response = request( 'http://localhost/appconfig/foo' );
a7afecf7 29 is( $response->content, 'bar', 'app finalize_config works' );
3af1b75e 30
587d381b 31 $response = request( 'http://localhost/appconfig/multi' );
3af1b75e 32 my $home = TestApp->config->{ home };
587d381b 33 my $path = join( ',',
34 $home, TestApp->path_to( 'x' ),
35 $home, TestApp->path_to( 'y' ) );
3af1b75e 36 is( $response->content, $path, 'vars substituted in config var, twice' );
a7afecf7 37}