From 606b117f2c5246eafd5b2001fd211d79aba85447 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Wed, 15 Sep 2010 16:14:40 +0200 Subject: update tests --- t/spore-response/body.t | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 't/spore-response/body.t') diff --git a/t/spore-response/body.t b/t/spore-response/body.t index 2a35d6b..26c7baf 100644 --- a/t/spore-response/body.t +++ b/t/spore-response/body.t @@ -10,12 +10,25 @@ sub r($) { return $res->finalize->[2]; } +sub raw($) { + my $res = Net::HTTP::Spore::Response->new(200); + $res->raw_body(@_); + return $res->raw_body; +} + +sub content($) { + my $res = Net::HTTP::Spore::Response->new(200); + $res->body(@_); + return $res->content; +} + is_deeply r "Hello World", "Hello World"; is_deeply r [ "Hello", "World" ], [ "Hello", "World" ]; -{ - my $uri = URI->new("foo"); # stringified object - is_deeply r $uri, $uri; -} +is_deeply raw "Hello World", "Hello World"; +is_deeply raw [ "Hello", "World" ], [ "Hello", "World" ]; + +is_deeply content "Hello World", "Hello World"; +is_deeply content [ "Hello", "World" ], [ "Hello", "World" ]; done_testing; -- cgit 1.4.1