R/remove_request_stub.R

Defines functions remove_request_stub

Documented in remove_request_stub

#' Remove a request stub
#'
#' @export
#' @param stub a request stub, of class `StubbedRequest`
#' @return logical, `TRUE` if removed, `FALSE` if not removed
#' @family stub-registry
#' @examples
#' (x <- stub_request("get", "https://httpbin.org/get"))
#' stub_registry()
#' remove_request_stub(x)
#' stub_registry()
remove_request_stub <- function(stub) {
  stopifnot(inherits(stub, "StubbedRequest"))
  webmockr_stub_registry$remove_request_stub(stub = stub)
}

Try the webmockr package in your browser

Any scripts or data that you put into this service are public.

webmockr documentation built on March 7, 2023, 5:25 p.m.