Skip to content

Commit

Permalink
FIX broken tests (status, send_file and content_type)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Sukrieh committed Feb 5, 2011
1 parent 90e2d3c commit 2d6814b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Dancer.pm
Expand Up @@ -174,6 +174,7 @@ sub session {
: Dancer::Session->write(@_);
}
}
sub status { Dancer::Response::status(@_) }
sub splat {
my $splat = Dancer::SharedData->request->params->{splat};
return ref $splat ? @$splat : ();
Expand Down
3 changes: 2 additions & 1 deletion lib/Dancer/Renderer.pm
Expand Up @@ -167,7 +167,8 @@ sub get_file_response_for_path {
Dancer::Response::status($status);
Dancer::Response::content_type(
get_mime_type($static_file));
return $fh;
Dancer::Response::content($fh);
return Dancer::Response->current;
}
return;
}
Expand Down
5 changes: 5 additions & 0 deletions lib/Dancer/Response.pm
Expand Up @@ -144,6 +144,11 @@ sub halted {
$current && $current->{halted}
}

sub content {
$CURRENT->{content} = $_[0]
if defined $CURRENT;
}

sub header {
my $current = _get_object(shift);
my $header = shift;
Expand Down

0 comments on commit 2d6814b

Please sign in to comment.