From 9cacfa256a9f9c3798b0d8b67e413217a32ec90c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 27 Sep 2012 11:09:11 -0500 Subject: add 'host' method --- t/base.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 't') 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; -- cgit v1.2.3-54-g00ecf