tests/testthat/test-function-clear_cache.R

test_that("clear_cache() works", {

  f <- kwb.utils:::clear_cache
  
  expect_output(f())
  expect_output(f(), "No cached files")
  
  x <- 1
  kwb.utils:::cache_and_return(x)
  
  expect_output(f(), "Clearing")
  
  expect_null(kwb.utils:::get_cached("x"))
})
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.