Skip to content

Commit

Permalink
fix test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed Jan 2, 2010
1 parent 0f1a389 commit 49e19b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions t/Plack-Middleware/xsendfile.t
Expand Up @@ -7,6 +7,10 @@ use Plack::Builder;
use Plack::Test;
use Cwd;

sub is_wo_case($$;$) {
is lc $_[0], lc $_[1], $_[2];
}

my $handler = builder {
enable "Plack::Middleware::XSendfile";
enable "Plack::Middleware::Static",
Expand All @@ -21,8 +25,7 @@ test_psgi app => $handler, client => sub {
my $req = GET "http://localhost/t/00_compile.t", 'X-Sendfile-Type' => 'X-Sendfile';
my $res = $cb->($req);
is $res->content_type, 'text/troff';;
# Can fail on Win32 when drive letter (C:) is uppercase instead of lowercase
is lc $res->header('X-Sendfile'), lc Cwd::realpath("t/00_compile.t");
is_wo_case $res->header('X-Sendfile'), Cwd::realpath("t/00_compile.t"); # wo_case for Win32--
is $res->content, '';
}
};
Expand Down

0 comments on commit 49e19b6

Please sign in to comment.