summary refs log tree commit diff
path: root/t/spore-request/finalize.t
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-09-13 13:31:56 +0200
committerfranck cuny <franck@lumberjaph.net>2010-09-13 13:31:56 +0200
commit3e3dc478fc9b4eb90681df89156dfcc8f7f81481 (patch)
treeb9788b0d48f524bc4c0aeeb48c744a8f7b097910 /t/spore-request/finalize.t
downloadnet-http-spore-3e3dc478fc9b4eb90681df89156dfcc8f7f81481.tar.gz
initial import
Diffstat (limited to 't/spore-request/finalize.t')
-rw-r--r--t/spore-request/finalize.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/spore-request/finalize.t b/t/spore-request/finalize.t
new file mode 100644
index 0000000..230c416
--- /dev/null
+++ b/t/spore-request/finalize.t
@@ -0,0 +1,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',
+    REQUEST_URI     => '',
+    QUERY_STRING    => '',
+    SERVER_PROTOCOL => 'HTTP/1.0',
+    'spore.params'  => [qw/database test_spore key foo rev 123/],
+};
+
+ok my $request = Net::HTTP::Spore::Request->new($env);
+
+ok my $http_req = $request->finalize();
+isa_ok($http_req, 'HTTP::Request');
+
+is $env->{PATH_INFO}, '/test_spore';
+is $env->{QUERY_STRING}, 'key=foo&rev=123';
+is $http_req->uri->canonical, 'http://localhost/test_spore?key=foo&rev=123';
+
+done_testing;