tests/testthat/test-utils.R

test_that("create_if_not works", {

  # Test creating new
  expect_warning(
    create_if_not(
      file.path(tempdir(), "junk_directory")
    ),
    NA
  )

  # Test with existing
  expect_warning(
    create_if_not(
      file.path(tempdir(), "junk_directory")
    ),
    NA
  )
})
ropensci/unifir documentation built on Feb. 6, 2024, 4:36 p.m.