Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed portability issues in lite_app.t and command.t
  • Loading branch information
kraih committed Jun 24, 2011
1 parent f3af1b1 commit 5d97f64
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
9 changes: 5 additions & 4 deletions Changes
Expand Up @@ -6,6 +6,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Improved documentation.
- Fixed support for multiple checkboxes with same name in
Mojolicious::Plugin::TagHelper.
- Fixed portability issue in "lite_app.t". (marcus)

1.47 2011-06-22 00:00:00
- Added EXPERIMENTAL callback condition plugin.
Expand Down Expand Up @@ -1256,7 +1257,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Updated Mojo::Server::FastCGI and Mojo::Server::Daemon::Prefork to
use the application logger.
- Fixed import problem in Mojo::Server::Daemon::Prefork. (James Duncan)
- Fixed warning in template.t.
- Fixed warning in "template.t".

0.991238 2009-07-16 00:00:00
- Fixed all shebang lines.
Expand Down Expand Up @@ -1287,7 +1288,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Simplified Mojo::Home.
- Moved executable detection to Test::Mojo::Server.
- Improved Mojo::Loader::Exception.
- Moved persistent_error.t tests to app.t.
- Moved "persistent_error.t" tests to "app.t".
- Cleaned up code.
- Fixed at_least_version. (yuki-kimoto)

Expand Down Expand Up @@ -1455,7 +1456,7 @@ This file documents the revision history for Perl extension Mojolicious.
0.8007 2008-11-07 00:00:00
- Cleaned up the api some more.
- Added param to Mojo::Message.
- Added server.t. (Mark Stosberg)
- Added "server.t". (Mark Stosberg)
- Added documentation. (Mark Stosberg)
- Cleaned up Mojo::File api.
- Fixed infinite loop in Mojo::File. (Leon Brocard)
Expand Down Expand Up @@ -1494,7 +1495,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Removed OS X resource fork files.

0.8.1 2008-11-01 00:00:00
- Made daemon.t developer only.
- Made "daemon.t" developer only.
- Fixed typos.

0.8 2008-10-21 00:00:00
Expand Down
3 changes: 3 additions & 0 deletions t/mojo/command.t
Expand Up @@ -5,6 +5,7 @@ use warnings;

use Test::More tests => 17;

use Cwd 'getcwd';
use File::Spec;
use File::Temp;

Expand Down Expand Up @@ -64,6 +65,7 @@ is $command->class_to_path('Foo::Bar'), 'Foo/Bar.pm', 'right path';

# Generating files
my $dir = File::Temp::tempdir(CLEANUP => 1);
my $cwd = getcwd;
chdir $dir;
$command->create_rel_dir('foo/bar');
is -d File::Spec->catdir($dir, qw/foo bar/), 1, 'directory exists';
Expand All @@ -79,3 +81,4 @@ is -e $command->rel_file('bar/baz.txt'), 1, 'file is executable';
$command->write_rel_file('123.xml', "seems\nto\nwork");
open my $xml, '<', $command->rel_file('123.xml');
is join('', <$xml>), "seems\nto\nwork", 'right result';
chdir $cwd;
13 changes: 6 additions & 7 deletions t/mojolicious/lite_app.t
Expand Up @@ -1018,9 +1018,9 @@ $t->get_ok('/.html')->status_is(200)
"/root.html\n/root.html\n/root.html\n/root.html\n/root.html\n");

# GET /0 ("X-Forwarded-For")
my $source = $t->tx->local_address;
$t->get_ok('/0', {'X-Forwarded-For' => '192.168.2.2, 192.168.2.1'})
->status_is(200)
->content_like(qr/http\:\/\/localhost\:\d+\/0\-127\.0\.0\.1\-0/);
->status_is(200)->content_like(qr/http\:\/\/localhost\:\d+\/0\-$source\-0/);

# GET /0 (reverse proxy with "X-Forwarded-For")
my $backup2 = $ENV{MOJO_REVERSE_PROXY};
Expand All @@ -1032,27 +1032,26 @@ $ENV{MOJO_REVERSE_PROXY} = $backup2;

# GET /0 ("X-Forwarded-Host")
$t->get_ok('/0', {'X-Forwarded-Host' => 'mojolicio.us:8080'})->status_is(200)
->content_like(qr/http\:\/\/localhost\:\d+\/0\-127\.0\.0\.1\-0/);
->content_like(qr/http\:\/\/localhost\:\d+\/0\-$source\-0/);

# GET /0 (reverse proxy with "X-Forwarded-Host")
$backup2 = $ENV{MOJO_REVERSE_PROXY};
$ENV{MOJO_REVERSE_PROXY} = 1;
$t->get_ok('/0', {'X-Forwarded-Host' => 'mojolicio.us:8080'})->status_is(200)
->content_is('http://mojolicio.us:8080/0-127.0.0.1-0');
->content_is("http://mojolicio.us:8080/0-$source-0");
$ENV{MOJO_REVERSE_PROXY} = $backup2;

# GET /0 ("X-Forwarded-HTTPS" and "X-Forwarded-Host")
$t->get_ok('/0',
{'X-Forwarded-HTTPS' => 1, 'X-Forwarded-Host' => 'mojolicio.us'})
->status_is(200)
->content_like(qr/http\:\/\/localhost\:\d+\/0\-127\.0\.0\.1\-0/);
->status_is(200)->content_like(qr/http\:\/\/localhost\:\d+\/0\-$source\-0/);

# GET /0 (reverse proxy with "X-Forwarded-HTTPS" and "X-Forwarded-Host")
$backup2 = $ENV{MOJO_REVERSE_PROXY};
$ENV{MOJO_REVERSE_PROXY} = 1;
$t->get_ok('/0',
{'X-Forwarded-HTTPS' => 1, 'X-Forwarded-Host' => 'mojolicio.us'})
->status_is(200)->content_is('https://mojolicio.us/0-127.0.0.1-0');
->status_is(200)->content_is("https://mojolicio.us/0-$source-0");
$ENV{MOJO_REVERSE_PROXY} = $backup2;

# DELETE /inline/epl
Expand Down

0 comments on commit 5d97f64

Please sign in to comment.