summary refs log tree commit diff
path: root/t/spore-request/new.t
diff options
context:
space:
mode:
Diffstat (limited to 't/spore-request/new.t')
-rw-r--r--t/spore-request/new.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/spore-request/new.t b/t/spore-request/new.t
new file mode 100644
index 0000000..6cb9d56
--- /dev/null
+++ b/t/spore-request/new.t
@@ -0,0 +1,25 @@
+use strict;
+use Test::More;
+use Net::HTTP::Spore::Request;
+
+my $req = Net::HTTP::Spore::Request->new(
+    {
+        REQUEST_METHOD    => 'GET',
+        SERVER_PROTOCOL   => 'HTTP/1.1',
+        SERVER_PORT       => 80,
+        SERVER_NAME       => 'example.com',
+        SCRIPT_NAME       => '/foo',
+        REMOTE_ADDR       => '127.0.0.1',
+        'spore.scheme'    => 'http',
+    }
+);
+
+isa_ok( $req, 'Net::HTTP::Spore::Request' );
+
+is( $req->method,   'GET',                    'method' );
+is( $req->protocol, 'HTTP/1.1',               'protocol' );
+is( $req->uri,      'http://example.com/foo', 'uri' );
+is( $req->port,     80,                       'port' );
+is( $req->scheme,   'http',                   'url_scheme' );
+
+done_testing();