no need for requests in unit_core_container_live_auto.t
André Walker [Wed, 8 Jun 2011 21:03:17 +0000 (18:03 -0300)]
t/aggregate/unit_core_container_live_auto.t
t/lib/TestAppContainer/Controller/Config.pm

index 74f5c3e..be1879d 100644 (file)
@@ -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;
index a5b8264..9aa70bb 100644 (file)
@@ -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;