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

})
rstudio/renv documentation built on July 8, 2024, 5:48 a.m.