tests/testthat/test-use_na.R

withr::local_dir(path)

test_that("use_na copies template file to destination folder", {
    file_path <- file.path(getwd(), "temp", "utils-na.R")
    expect_null(use_na(path = "temp", export = TRUE))
    expect_true(file.exists(file_path))
    expect_match(read_lines(file_path), "export")
})

Try the usethat package in your browser

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

usethat documentation built on Sept. 20, 2021, 5:08 p.m.