tests/testthat/test-once.R

test_that("once() returns TRUE only once", {

  method <- function() {
    expect_true(once())
    expect_false(once())
    expect_false(once())
  }

  method()
  expect_error(method())

})

Try the renv package in your browser

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

renv documentation built on Sept. 19, 2023, 9:06 a.m.