tests/testthat/helper-options.R

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

  force(code)
}
trestletech/plumber documentation built on May 6, 2024, 6:17 p.m.