Skip to content

Commit

Permalink
Fix Bric::Util::ApacheReq test failures.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
theory committed Apr 12, 2010
1 parent 843c950 commit 0266194
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions comp/widgets/help/debuggers.html
Expand Up @@ -92,4 +92,5 @@
<li>Iván Chavero</li>
<li>Zdravko Balorda</li>
<li>Vincent Stemen</li>
<li>Héctor Daniel Cortés González</li>
</ul>
13 changes: 13 additions & 0 deletions lib/Bric/Changes.pod
Expand Up @@ -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<Bric::Util::ApacheReq> tests where they would fail if the
C<LISTEN_PORT> or C<SSL_PORT> F<bricolage.conf> 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
Expand Down
2 changes: 2 additions & 0 deletions lib/Bric/License.pod
Expand Up @@ -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:
Expand Down
17 changes: 11 additions & 6 deletions t/Bric/Util/ApacheReq/Test.pm
Expand Up @@ -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';
}

Expand Down

0 comments on commit 0266194

Please sign in to comment.