added test 14
Sebastian Riedel [Sun, 20 Mar 2005 18:08:49 +0000 (18:08 +0000)]
t/14connection.t [new file with mode: 0644]

diff --git a/t/14connection.t b/t/14connection.t
new file mode 100644 (file)
index 0000000..85a3445
--- /dev/null
@@ -0,0 +1,22 @@
+package TestApp;
+
+use Catalyst;
+
+__PACKAGE__->action(
+    host => sub {
+        my ( $self, $c ) = @_;
+        $c->res->output( $c->req->hostname );
+    },
+    address => sub {
+        my ( $self, $c ) = @_;
+        $c->res->output( $c->req->address );
+    }
+);
+
+package main;
+
+use Test::More tests => 2;
+use Catalyst::Test 'TestApp';
+
+ok( get('/hostname') eq 'localhost' );
+ok( get('/address')  eq '127.0.0.1' );