blob: e7509d69b7e2ff5d8c90f73bcd1df8b7c63e95e0 (
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
24
|
use strict;
use warnings;
use Test::More;
use Net::HTTP::Spore;
my $mock_server = {
'/test_spore/_all_docs' => sub {
my $req = shift;
$req->new_response( 200, [ 'Content-Type' => 'text/plan' ], 'ok');
},
};
ok my $client =
Net::HTTP::Spore->new_from_spec( 't/specs/couchdb.json',
api_base_url => 'http://localhost:5984' );
$client->enable('Runtime');
$client->enable('Mock', tests => $mock_server);
my $res = $client->get_all_documents(database => 'test_spore');
ok $res->header('X-Spore-Runtime');
done_testing;
|