summary refs log tree commit diff
path: root/t/spore-request/path_info.t
blob: 17645af9e42a83be9cedb4bbc19add65d019b1bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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';

is $request->path, '/test_spore/foo';

done_testing;