StubRegistry {webmockr} | R Documentation |
StubRegistry
Description
stub registry to keep track of StubbedRequest stubs
Public fields
request_stubs
(list) list of request stubs
Methods
Public methods
Method print()
print method for the StubRegistry
class
Usage
StubRegistry$print(x, ...)
Arguments
x
self
...
ignored
Method register_stub()
Register a stub
Usage
StubRegistry$register_stub(stub)
Arguments
stub
an object of type StubbedRequest
Returns
nothing returned; registers the stub
Method find_stubbed_request()
Find a stubbed request
Usage
StubRegistry$find_stubbed_request(req)
Arguments
req
an object of class RequestSignature
Returns
an object of type StubbedRequest, if matched
Method request_stub_for()
Find a stubbed request
Usage
StubRegistry$request_stub_for(request_signature, count = TRUE)
Arguments
request_signature
an object of class RequestSignature
count
(bool) iterate counter or not. default:
TRUE
Returns
logical, 1 or more
Method remove_request_stub()
Remove a stubbed request by matching request signature
Usage
StubRegistry$remove_request_stub(stub)
Arguments
stub
an object of type StubbedRequest
Returns
nothing returned; removes the stub from the registry
Method remove_all_request_stubs()
Remove all request stubs
Usage
StubRegistry$remove_all_request_stubs()
Returns
nothing returned; removes all request stubs
Method is_registered()
Find a stubbed request from a request signature
Usage
StubRegistry$is_registered(x)
Arguments
x
an object of class RequestSignature
Returns
nothing returned; registers the stub
Method is_stubbed()
Check if a stubbed request is in the stub registry
Usage
StubRegistry$is_stubbed(stub)
Arguments
stub
an object of class StubbedRequest
Returns
single boolean, TRUE
or FALSE
Method clone()
The objects of this class are cloneable with this method.
Usage
StubRegistry$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
See Also
Other stub-registry:
remove_request_stub()
,
stub_registry()
,
stub_registry_clear()