Skip to content

Commit

Permalink
more response tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 3, 2012
1 parent 8dc2915 commit eece904
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@

3.65 2012-12-03
- Improved documentation.
- Improved tests.

3.64 2012-12-01
- Improved documentation.
Expand Down
11 changes: 11 additions & 0 deletions t/mojo/response.t
Expand Up @@ -939,6 +939,17 @@ $res->content(Mojo::Content::MultiPart->new);
$res->body('hi!');
is $res->body, 'hi!', 'right content';

# Body exceeding memory limit (no upgrade)
{
local $ENV{MOJO_MAX_MEMORY_SIZE} = 8;
$res = Mojo::Message::Response->new;
$res->body('hi there!');
is $res->body, 'hi there!', 'right content';
is $res->content->asset->max_memory_size, 8, 'right size';
is $res->content->asset->size, 9, 'right size';
ok !$res->content->asset->is_file, 'stored in memory';
}

# Parse response and extract JSON data
$res = Mojo::Message::Response->new;
$res->parse("HTTP/1.1 200 OK\x0a");
Expand Down

0 comments on commit eece904

Please sign in to comment.