From: André Walker Date: Wed, 8 Jun 2011 21:03:17 +0000 (-0300) Subject: no need for requests in unit_core_container_live_auto.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=4ae2ac516e55d27ca685bbbfc6773b66db8e6553 no need for requests in unit_core_container_live_auto.t --- diff --git a/t/aggregate/unit_core_container_live_auto.t b/t/aggregate/unit_core_container_live_auto.t index 74f5c3e..be1879d 100644 --- a/t/aggregate/unit_core_container_live_auto.t +++ b/t/aggregate/unit_core_container_live_auto.t @@ -4,27 +4,22 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; -use Test::More tests => 5; - -use Catalyst::Test 'TestAppContainer'; - -{ - my $response; - ok( $response = request( 'http://localhost/config/' ), 'request ok' ); - is( $response->content, 'foo', 'config ok' ); - - $response = request( 'http://localhost/appconfig/cache' ); - ok( $response->content && $response->content !~ /^__HOME__/, - 'home dir substituted in config var' - ); - - $response = request( 'http://localhost/appconfig/foo' ); - is( $response->content, 'bar', 'app finalize_config works' ); - - $response = request( 'http://localhost/appconfig/multi' ); - my $home = TestAppContainer->config->{ home }; - my $path = join( ',', - $home, TestAppContainer->path_to( 'x' ), - $home, TestAppContainer->path_to( 'y' ) ); - is( $response->content, $path, 'vars substituted in config var, twice' ); -} +use Test::More; + +use_ok('TestAppContainer'); + +is( TestAppContainer->controller('Config')->{foo}, 'foo', 'config ok' ); + +ok( TestAppContainer->config->{cache} !~ /^__HOME__/, + 'home dir substituted in config var' +); + +is( TestAppContainer->config->{foo}, 'bar', 'app finalize_config works' ); + +my $home = TestAppContainer->config->{ home }; +my $path = join ',', + $home, TestAppContainer->path_to( 'x' ), + $home, TestAppContainer->path_to( 'y' ); +is( TestAppContainer->config->{multi}, $path, 'vars substituted in config var, twice' ); + +done_testing; diff --git a/t/lib/TestAppContainer/Controller/Config.pm b/t/lib/TestAppContainer/Controller/Config.pm index a5b8264..9aa70bb 100644 --- a/t/lib/TestAppContainer/Controller/Config.pm +++ b/t/lib/TestAppContainer/Controller/Config.pm @@ -5,14 +5,4 @@ use warnings; use base qw( Catalyst::Controller ); -sub index : Private { - my ( $self, $c ) = @_; - $c->res->output( $self->{ foo } ); -} - -sub appconfig : Global { - my ( $self, $c, $var ) = @_; - $c->res->body( $c->config->{ $var } ); -} - 1;