[Catalyst-commits] r6909 - in
trunk/Catalyst-Plugin-ConfigLoader-Remote/t: . lib
lib/TestApp lib/TestApp/root lib/TestApp/root/static
edenc at dev.catalyst.perl.org
edenc at dev.catalyst.perl.org
Mon Sep 17 17:25:31 GMT 2007
Author: edenc
Date: 2007-09-17 17:25:30 +0100 (Mon, 17 Sep 2007)
New Revision: 6909
Added:
trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/
trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp.pm
trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp/
trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp/root/
trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp/root/static/
trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp/root/static/config.yml
trunk/Catalyst-Plugin-ConfigLoader-Remote/t/live.t
Log:
added live tests for C::P::ConfigLoader::Remote
Added: trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp/root/static/config.yml
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp/root/static/config.yml (rev 0)
+++ trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp/root/static/config.yml 2007-09-17 16:25:30 UTC (rev 6909)
@@ -0,0 +1,8 @@
+---
+scalar: foo
+array:
+ - foo
+ - bar
+ - baz
+hash:
+ foo: bar
Added: trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp.pm (rev 0)
+++ trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp.pm 2007-09-17 16:25:30 UTC (rev 6909)
@@ -0,0 +1,42 @@
+package TestApp;
+
+use strict;
+use warnings;
+
+use Catalyst::Runtime '5.70';
+use Test::More;
+
+use Catalyst qw(ConfigLoader::Remote Static::Simple);
+
+__PACKAGE__->setup;
+
+sub root : Chained('/') PathPart('') CaptureArgs(0) {
+}
+
+sub base : Chained('root') CaptureArgs(0) PathPart('') {
+}
+
+sub test : Chained('base') CaptureArgs(0) {
+}
+
+sub scalar : Chained('test') Args(0) {
+ my ( $self, $c ) = @_;
+ is( $c->config->{scalar}, 'foo' );
+}
+
+sub array : Chained('test') Args(0) {
+ my ( $self, $c ) = @_;
+ is_deeply( $c->config->{array}, [qw/foo bar baz/] );
+}
+
+sub hash : Chained('test') Args(0) {
+ my ( $self, $c ) = @_;
+ is_deeply( $c->config->{hash}, { foo => 'bar' } );
+}
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body('ok');
+}
+
+1;
Added: trunk/Catalyst-Plugin-ConfigLoader-Remote/t/live.t
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader-Remote/t/live.t (rev 0)
+++ trunk/Catalyst-Plugin-ConfigLoader-Remote/t/live.t 2007-09-17 16:25:30 UTC (rev 6909)
@@ -0,0 +1,18 @@
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+
+use FindBin;
+use lib "$FindBin::Bin/../t/lib";
+
+use Catalyst::Test 'TestApp';
+
+TODO: {
+ local $TODO = 'ConfigLoader::Remote not implemented yet';
+
+ # these requests run tests inside their equivalent actions
+ request('http://localhost/test/scalar');
+ request('http://localhost/test/array');
+ request('http://localhost/test/hash');
+}
More information about the Catalyst-commits
mailing list