Skip to content

Commit

Permalink
a few more response tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 14, 2013
1 parent 5b1a2d8 commit 7ed034e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions t/mojo/response.t
Expand Up @@ -82,6 +82,17 @@ is $res->code(510)->default_message, 'Not Extended', 'right message';
is $res->code(511)->default_message, 'Network Authentication Required',
'right message';

# Status code ranges
ok $res->code(200)->is_status_class(200), 'is in range';
ok $res->code(201)->is_status_class(200), 'is in range';
ok $res->code(299)->is_status_class(200), 'is in range';
ok $res->code(302)->is_status_class(300), 'is in range';
ok !$res->code(199)->is_status_class(200), 'not in range';
ok !$res->code(300)->is_status_class(200), 'not in range';
ok !$res->code(200)->is_status_class(100), 'not in range';
ok !$res->code(200)->is_status_class(300), 'not in range';
ok !$res->code(undef)->is_status_class(200), 'no range';

# Status code and message
$res = Mojo::Message::Response->new;
is $res->code, undef, 'no status';
Expand Down

0 comments on commit 7ed034e

Please sign in to comment.