summaryrefslogtreecommitdiff
path: root/t/spore-response/body.t
blob: 2a35d6b61ff995fcbf53659bb032f6ad51f0d7de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;
use Test::More;
use Net::HTTP::Spore::Response;
use URI;

sub r($) {
    my $res = Net::HTTP::Spore::Response->new(200);
    $res->body(@_);
    return $res->finalize->[2];
}

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;
}

done_testing;