summary refs log tree commit diff
path: root/t/spore-response/response.t
blob: 56be6d298826b287198a03e00c5545ff01dd1977 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;
use Test::More;
use Net::HTTP::Spore::Response;

sub res {
    my $res = Net::HTTP::Spore::Response->new;
    my %v   = @_;
    while ( my ( $k, $v ) = each %v ) {
        $res->$k($v);
    }
    $res->finalize;
}

is_deeply(
    res(
        status => 200,
        body   => 'hello',
    ),
    [ 200, +[], 'hello' ]
);

done_testing;