2 # ABSTRACT: A backend for testing HTTP::AnyUA
7 sub new
{ bless {}, shift }
11 $response = $backend->response;
12 $response = $backend->response($response);
14 Get
and set the response hashref
or L
<Future
> that this backend will always respond with
.
18 sub response
{ @_ == 2 ? $_[0]->{response
} = pop : $_[0]->{response
} }
22 @requests = $backend->requests;
24 Get the requests the backend
has handled so far
.
28 sub requests
{ @{$_[0]->{requests
} || []} }
33 push @{$self->{requests
} ||= []}, [@_];
35 return $self->response;