tests/testthat/helper-file.R

test_ref <- function(file) {
  rprojroot::is_testthat$find_file(paste0('ref/',file))
}

test_tmp <- function(file) {
  tmp_folder <- rprojroot::is_testthat$find_file('tmp')
  if (!file.exists(tmp_folder))
    dir.create(tmp_folder)
  rprojroot::is_testthat$find_file(paste0('tmp/',file))
}

remove_tmp <- function() {
  tmp_folder <- rprojroot::is_testthat$find_file('tmp')
  if (file.exists(tmp_folder))
    unlink(tmp_folder, recursive=TRUE)
}

Try the xlsx package in your browser

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

xlsx documentation built on Nov. 10, 2020, 3:52 p.m.