Commit | Line | Data |
---|---|---|
75c0bfcf | 1 | package TestApp; |
2 | ||
e05c5e3c | 3 | use Catalyst qw[-Engine=Test]; |
75c0bfcf | 4 | |
a8ed7612 | 5 | sub hostname : Global { |
6 | my ( $self, $c ) = @_; | |
7 | $c->res->output( $c->req->hostname ); | |
8 | } | |
9 | sub address : Global { | |
10 | my ( $self, $c ) = @_; | |
11 | $c->res->output( $c->req->address ); | |
12 | } | |
75c0bfcf | 13 | |
14 | package main; | |
15 | ||
16 | use Test::More tests => 2; | |
17 | use Catalyst::Test 'TestApp'; | |
18 | ||
19 | ok( get('/hostname') eq 'localhost' ); | |
20 | ok( get('/address') eq '127.0.0.1' ); |