tests/testthat/helper-options.R

with_options <- function(opts, code) {
  old_opts <- options(opts)
  on.exit({
    options(old_opts)
  }, add = TRUE)

  force(code)
}

Try the plumber package in your browser

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

plumber documentation built on Sept. 7, 2022, 1:05 a.m.