tests/testthat/test_findConfFile.R

test_that("findConfFile", {
  d = fs::path_real(fs::path_temp())
  fn = fs::path(d, "batchtools.conf.R")
  fs::file_create(fn)
  withr::with_dir(d,
    expect_equal(findConfFile(), fs::path_abs(fn))
  )
  withr::with_envvar(list(R_BATCHTOOLS_SEARCH_PATH = d),
    expect_equal(findConfFile(), fs::path_abs(fn))
  )
  fs::file_delete(fn)
})

Try the batchtools package in your browser

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

batchtools documentation built on April 20, 2023, 5:09 p.m.