4 use Test::More tests => 4;
8 ##############################################################################
9 ### No env vars defined
10 ##############################################################################
12 ok( !Catalyst::Utils::env_value( 'MyApp', 'Key' ),
13 'No env values defined returns false'
17 ##############################################################################
18 ### App env var defined
19 ##############################################################################
21 $ENV{'MYAPP2_KEY'} = 'Env value 2';
22 is( Catalyst::Utils::env_value( 'MyApp2', 'Key' ),
23 'Env value 2', 'Got the right value from the application var' );
26 ##############################################################################
27 ### Catalyst env var defined
28 ##############################################################################
30 $ENV{'CATALYST_KEY'} = 'Env value 3';
31 is( Catalyst::Utils::env_value( 'MyApp3', 'Key' ),
32 'Env value 3', 'Got the right value from the catalyst var' );
35 ##############################################################################
36 ### Catalyst and Application env vars defined
37 ##############################################################################
39 $ENV{'CATALYST_KEY'} = 'Env value bad';
40 $ENV{'MYAPP4_KEY'} = 'Env value 4';
41 is( Catalyst::Utils::env_value( 'MyApp4', 'Key' ),
42 'Env value 4', 'Got the right value from the application var' );