summary refs log tree commit diff
path: root/t/spore-request/exception.t
blob: 162370a38a44ebacae607aa6b7dbbacd3651df1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use warnings;

use Test::More;
use Net::HTTP::Spore;

ok my $client =
  Net::HTTP::Spore->new_from_spec( 't/specs/couchdb.json',
    api_base_url => 'http://localhost:5984' );

$client->enable( 'Test::Response', callback => sub { die } );

my $res = $client->get_all_documents(database => 'test_spore');
is $res->[0], 599;
like $res->[2]->{error}, qr/Died/;

done_testing;