library(testthat)
library(jeksterslabRutils)
context("Test util_make_subdir.")

Parameters

Initialize folders in the working directory

tmp_01 <- util_make_subdir()
tmp_02 <- util_make_subdir()

testthat

test_that("expect_warning", {
  expect_warning(
    util_make_subdir(
      subdir = basename(tmp_01)
    )
  )
})
#> Test passed 🌈
test_that("expect_true", {
  expect_true(
    dir.exists(
      tmp_02
    )
  )
})
#> Test passed 🎊

Clean up files and folders

util_clean_dir(
  dir = tmp_01,
  create_dir = FALSE
)
util_clean_dir(
  dir = tmp_02,
  create_dir = FALSE
)