From 026619484a0d3943f24dcb831f01522fe86dbfeb Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Mon, 12 Apr 2010 16:43:03 -0700 Subject: [PATCH] Fix Bric::Util::ApacheReq test failures. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixe bug in the Bric::Util::ApacheReq tests where they would fail if the `LISTEN_PORT` or `SSL_PORT` `bricolage.conf` directives were anything other than 80 and 443, respectively. Thanks to Héctor Daniel Cortés González for the report. --- comp/widgets/help/debuggers.html | 1 + lib/Bric/Changes.pod | 13 +++++++++++++ lib/Bric/License.pod | 2 ++ t/Bric/Util/ApacheReq/Test.pm | 17 +++++++++++------ 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/comp/widgets/help/debuggers.html b/comp/widgets/help/debuggers.html index 597459a46..61ec0e3db 100644 --- a/comp/widgets/help/debuggers.html +++ b/comp/widgets/help/debuggers.html @@ -92,4 +92,5 @@
  • Iván Chavero
  • Zdravko Balorda
  • Vincent Stemen
  • +
  • Héctor Daniel Cortés González
  • diff --git a/lib/Bric/Changes.pod b/lib/Bric/Changes.pod index e445bb634..d1670a762 100644 --- a/lib/Bric/Changes.pod +++ b/lib/Bric/Changes.pod @@ -10,6 +10,19 @@ This document lists the Changes to Bricolage introduced with each release. =head1 Version 2.0.1 () +=head2 Bug Fixes + +=over + +=item * + +Fixed a bug in the L tests where they would fail if the +C or C F directives were anything other +than 80 and 443, respectively. Thanks to Héctor Daniel Cortés González for the +report. [David] + +=back + =head1 Version 2.0.0 (2010-04-12) =head2 Bug Fixes diff --git a/lib/Bric/License.pod b/lib/Bric/License.pod index 06da45e4b..47bbf471a 100644 --- a/lib/Bric/License.pod +++ b/lib/Bric/License.pod @@ -490,6 +490,8 @@ Friends who have spotted bugs include: =item * Vincent Stemen +=item * Héctor Daniel Cortés González + =back Bricolage's translation team: diff --git a/t/Bric/Util/ApacheReq/Test.pm b/t/Bric/Util/ApacheReq/Test.pm index 6ebf4de21..ba12fc513 100644 --- a/t/Bric/Util/ApacheReq/Test.pm +++ b/t/Bric/Util/ApacheReq/Test.pm @@ -18,17 +18,22 @@ sub _test_load : Test(1) { sub test_url : Test(6) { my $mock = Test::MockModule->new($CLASS); $mock->mock( instance => My::Big::Fat::Req->new ); + my $port = LISTEN_PORT == 80 ? '' : ':' . LISTEN_PORT; ok $CLASS->url, "$CLASS->url should return something"; - is $CLASS->url, 'http://www.example.com/', 'And it should be the right thing'; - is $CLASS->url( uri => '/foo'), 'http://www.example.com/foo', + is $CLASS->url, "http://www.example.com$port/", 'And it should be the right thing'; + is $CLASS->url( uri => '/foo'), "http://www.example.com$port/foo", 'The uri param should work'; - is $CLASS->url( uri => ''), 'http://www.example.com', + is $CLASS->url( uri => ''), "http://www.example.com$port", 'An empty uri param should work'; - my $s = SSL_ENABLE ? 's' : ''; - is $CLASS->url( ssl => 1), "http$s://www.example.com/", + my $s = ''; + if (SSL_ENABLE) { + $s = 's'; + $port = SSL_PORT == 443 ? '' : ':' . SSL_PORT; + } + is $CLASS->url( ssl => 1), "http$s://www.example.com$port/", 'The ssl param should work'; - is $CLASS->url( uri => '/foo', ssl => 1), "http$s://www.example.com/foo", + is $CLASS->url( uri => '/foo', ssl => 1), "http$s://www.example.com$port/foo", 'The uri and ssl params should work together'; }