Learn R Programming

webmockr (version 2.0.0)

last_stub: Get the last stub created

Description

Get the last stub created

Usage

last_stub()

Arguments

Value

NULL if no stubs found; otherwise the last stub created as a StubbedRequest class

Examples

Run this code
if (FALSE) { # interactive()
# 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()
}

Run the code above in your browser using DataLab