last_stub: Get the last stub created

View source: R/last.R

last_stubR 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()


ropensci/webmockr documentation built on June 14, 2025, 1:24 p.m.