diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-09-13 13:31:56 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-09-13 13:31:56 +0200 |
| commit | 3e3dc478fc9b4eb90681df89156dfcc8f7f81481 (patch) | |
| tree | b9788b0d48f524bc4c0aeeb48c744a8f7b097910 /t/spore-request/path_info.t | |
| download | net-http-spore-3e3dc478fc9b4eb90681df89156dfcc8f7f81481.tar.gz | |
initial import
Diffstat (limited to '')
| -rw-r--r-- | t/spore-request/path_info.t | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/spore-request/path_info.t b/t/spore-request/path_info.t new file mode 100644 index 0000000..020a958 --- /dev/null +++ b/t/spore-request/path_info.t @@ -0,0 +1,25 @@ +use strict; +use Test::More; + +use Net::HTTP::Spore::Request; + +my $env = { + REQUEST_METHOD => 'GET', + SERVER_NAME => 'localhost', + SERVER_PORT => '80', + SCRIPT_NAME => '', + PATH_INFO => '/:database/:key', + REQUEST_URI => '', + QUERY_STRING => '', + SERVER_PROTOCOL => 'HTTP/1.0', + 'spore.params' => [qw/database test_spore key foo/], +}; + +ok my $request = Net::HTTP::Spore::Request->new($env); + +is $request->path_info, '/test_spore/foo'; + +$env->{'spore.params'} = [qw/database test_spore key foo another key/]; +is $request->path_info, '/test_spore/foo'; + +done_testing; |
