From 69b58eba5bc8a01e27c74d6d2346738fdf9f8eb5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 20 Jul 2012 03:40:00 -0500 Subject: rename ->body to ->content on ::Response --- t/path_info.t | 2 +- t/path_info_escaped.t | 2 +- t/response-body.t | 2 +- t/response-compatible.t | 10 +++++----- t/response.t | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 't') diff --git a/t/path_info.t b/t/path_info.t index bab50b9..d5cbbcc 100644 --- a/t/path_info.t +++ b/t/path_info.t @@ -12,7 +12,7 @@ my $path_app = sub { my $req = Web::Request->new_from_env(shift); my $res = $req->new_response(status => 200); $res->content_type('text/plain'); - $res->body($req->path_info); + $res->content($req->path_info); return $res->finalize; }; diff --git a/t/path_info_escaped.t b/t/path_info_escaped.t index 28e712c..3bd4f62 100644 --- a/t/path_info_escaped.t +++ b/t/path_info_escaped.t @@ -12,7 +12,7 @@ my $path_app = sub { my $req = Web::Request->new_from_env(shift); my $res = $req->new_response(status => 200); $res->content_type('text/plain'); - $res->body('my ' . Dumper([ $req->uri, $req->parameters ])); + $res->content('my ' . Dumper([ $req->uri, $req->parameters ])); return $res->finalize; }; diff --git a/t/response-body.t b/t/response-body.t index 39e2e03..80056fe 100644 --- a/t/response-body.t +++ b/t/response-body.t @@ -10,7 +10,7 @@ use Web::Response; sub r($) { my $res = Web::Response->new(status => 200); - $res->body(@_); + $res->content(@_); return $res->finalize->[2]; } diff --git a/t/response-compatible.t b/t/response-compatible.t index 9fa8e54..daf2c54 100644 --- a/t/response-compatible.t +++ b/t/response-compatible.t @@ -9,7 +9,7 @@ use Web::Response; my $res = Web::Response->new; $res->status(200); $res->header("Foo:Bar" => "baz"); - $res->body("Hello"); + $res->content("Hello"); is_deeply $res->finalize, [ 200, [ 'Foo:Bar' => 'baz' ], ["Hello"] ]; } @@ -19,7 +19,7 @@ use Web::Response; $res->status(200); $res->header("Foo\000Bar" => "baz"); $res->header("Qux\177Quux" => "42"); - $res->body("Hello"); + $res->content("Hello"); is_deeply $res->finalize, [ 200, [ "Foo\000Bar" => 'baz', "Qux\177Quux" => '42' ], ["Hello"] ]; } @@ -29,7 +29,7 @@ use Web::Response; $res->status(200); $res->header("X-LWS-I" => "Bar\r\n true"); $res->header("X-LWS-II" => "Bar\r\n\t\ttrue"); - $res->body("Hello"); + $res->content("Hello"); is_deeply $res->finalize, [ @@ -43,7 +43,7 @@ use Web::Response; my $res = Web::Response->new; $res->status(200); $res->header("X-CR-LF" => "Foo\nBar\rBaz"); - $res->body("Hello"); + $res->content("Hello"); is_deeply $res->finalize, [ 200, [ 'X-CR-LF' => 'FooBarBaz' ], ["Hello"] ]; } @@ -52,7 +52,7 @@ use Web::Response; my $res = Web::Response->new; $res->status(200); $res->header("X-CR-LF" => "Foo\nBar\rBaz"); - $res->body("Hello"); + $res->content("Hello"); is_deeply $res->finalize, [ 200, [ 'X-CR-LF' => 'FooBarBaz' ], ["Hello"] ]; } diff --git a/t/response.t b/t/response.t index a189c4d..eedf540 100644 --- a/t/response.t +++ b/t/response.t @@ -16,8 +16,8 @@ sub res { is_deeply( res( - status => 200, - body => 'hello', + status => 200, + content => 'hello', ), [ 200, +[], [ 'hello' ] ] ); @@ -38,7 +38,7 @@ is_deeply( path => '/', }, }, - body => 'hello', + content => 'hello', ), [ 200, -- cgit v1.2.3-54-g00ecf