Skip to content

Commit

Permalink
Possibly fixed a long standing mysterious erorr reports -- Do not
Browse files Browse the repository at this point in the history
chdir during testing since that kills the delay loading MockHTTP in
the runtime.
  • Loading branch information
miyagawa committed Feb 6, 2010
1 parent 0a50522 commit 26384bd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions t/Plack-Middleware/static.t
Expand Up @@ -10,11 +10,10 @@ use Cwd;
use Plack::Test;

my $base = cwd;
chdir "t";

my $handler = builder {
enable "Plack::Middleware::Static",
path => sub { s!^/share/!!}, root => "$base/share";
path => sub { s!^/share/!!}, root => "share";
enable "Plack::Middleware::Static",
path => qr{\.(t|PL|txt)$}i, root => '.';
sub {
Expand All @@ -27,7 +26,7 @@ my %test = (
my $cb = shift;

{
my $path = "00_compile.t";
my $path = "t/00_compile.t";
my $res = $cb->(GET "http://localhost/$path");
is $res->content_type, 'text/troff', 'ok case';
like $res->content, qr/use Test::More/;
Expand Down Expand Up @@ -58,7 +57,7 @@ my %test = (
}

{
my $res = $cb->(GET "http://localhost/Plack-Middleware/static.txt");
my $res = $cb->(GET "http://localhost/t/Plack-Middleware/static.txt");
is $res->content_type, 'text/plain';
my($ct, $charset) = $res->content_type;
is $charset, 'charset=utf-8';
Expand Down

0 comments on commit 26384bd

Please sign in to comment.