summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-09-27 11:09:11 -0500
committerJesse Luehrs <doy@tozt.net>2012-09-27 11:09:11 -0500
commit9cacfa256a9f9c3798b0d8b67e413217a32ec90c (patch)
tree1cb1e34bc3d5e3cc646daa756c78d9215cf32d85 /t
parent217ffe760a9cded965c8dcf10bec2c44fdbfdca9 (diff)
downloadweb-request-9cacfa256a9f9c3798b0d8b67e413217a32ec90c.tar.gz
web-request-9cacfa256a9f9c3798b0d8b67e413217a32ec90c.zip
add 'host' method
Diffstat (limited to 't')
-rw-r--r--t/base.t8
1 files changed, 6 insertions, 2 deletions
diff --git a/t/base.t b/t/base.t
index af1a4ed..21aab54 100644
--- a/t/base.t
+++ b/t/base.t
@@ -26,11 +26,13 @@ my @tests = (
{ scheme => 'http',
server_name => 'example.com',
server_port => 80,
- base => 'http://example.com/' },
+ base => 'http://example.com/',
+ expected_host => 'example.com:80' },
{ scheme => 'http',
server_name => 'example.com',
server_port => 8080,
- base => 'http://example.com:8080/' },
+ base => 'http://example.com:8080/',
+ expected_host => 'example.com:8080' },
{ host => 'foobar.com',
server_name => 'example.com',
server_port => 8080,
@@ -48,6 +50,8 @@ for my $block (@tests) {
my $req = Web::Request->new_from_env($env);
is $req->base_uri, $block->{base};
+ my $expected_host = $block->{expected_host} || $block->{host};
+ is $req->host, $expected_host;
}
done_testing;