last_stub {webmockr} | R Documentation |
Get the last stub created
Description
Get the last stub created
Usage
last_stub()
Value
NULL
if no stubs found; otherwise the last stub created
as a StubbedRequest
class
Examples
# no requests
stub_registry_clear()
last_stub()
# a stub is found
stub_request("head", "https://nytimes.com")
last_stub()
stub_request("post", "https://nytimes.com/stories")
last_stub()
# cleanup
stub_registry_clear()
[Package webmockr version 2.2.0 Index]