Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test response progress

  • Loading branch information...
commit c5bf2b6cc070eafc497691b1fbe260a21e7d06d3 1 parent fabc833
@kraih authored
Showing with 7 additions and 5 deletions.
  1. +1 −1  lib/Mojo/Template.pm
  2. +6 −4 t/mojo/response.t
View
2  lib/Mojo/Template.pm
@@ -520,7 +520,7 @@ Character indicating the start of a comment, defaults to C<#>.
=head2 C<compiled>
my $compiled = $mt->compiled;
- $mt = $mt->compiled($code);
+ $mt = $mt->compiled($compiled);
Compiled template code.
View
10 t/mojo/response.t
@@ -1,6 +1,6 @@
use Mojo::Base -strict;
-use Test::More tests => 356;
+use Test::More tests => 357;
# "Quick Smithers. Bring the mind eraser device!
# You mean the revolver, sir?
@@ -233,7 +233,8 @@ is $res->body, "Hello World!\n1234\nlalalala\n", 'right content';
# Parse full HTTP 1.1 response (100 Continue)
$res = Mojo::Message::Response->new;
$res->content->on(body => sub { shift->headers->header('X-Body' => 'one') });
-$res->on(finish => sub { shift->headers->header('X-Finish' => 'two') });
+$res->on(progress => sub { shift->headers->header('X-Progress' => 'two') });
+$res->on(finish => sub { shift->headers->header('X-Finish' => 'three') });
$res->parse("HTTP/1.1 100 Continue\x0d\x0a\x0d\x0a");
ok $res->is_finished, 'response is finished';
ok $res->is_empty, 'response is empty';
@@ -242,8 +243,9 @@ is $res->code, 100, 'right status';
is $res->message, 'Continue', 'right message';
is $res->version, '1.1', 'right version';
is $res->headers->content_length, undef, 'no "Content-Length" value';
-is $res->headers->header('X-Body'), 'one', 'right "X-Body" value';
-is $res->headers->header('X-Finish'), 'two', 'right "X-Finish" value';
+is $res->headers->header('X-Body'), 'one', 'right "X-Body" value';
+is $res->headers->header('X-Progress'), 'two', 'right "X-Progress" value';
+is $res->headers->header('X-Finish'), 'three', 'right "X-Finish" value';
is $res->body, '', 'no content';
# Parse full HTTP 1.1 response (304 Not Modified)
Please sign in to comment.
Something went wrong with that request. Please try again.