1test_that("create_directory() doesn't bother a pre-existing target dir", {
2  tmp <- file_temp()
3  dir_create(tmp)
4  expect_true(is_dir(tmp))
5  expect_error_free(create_directory(tmp))
6  expect_true(is_dir(tmp))
7})
8
9test_that("create_directory() creates a directory", {
10  tmp <- file_temp("yes")
11  create_directory(tmp)
12  expect_true(is_dir(tmp))
13})
14
15# check_path_is_directory -------------------------------------------------
16
17test_that("no false positive for trailing slash", {
18  pwd <- sub("/$", "", getwd())
19  expect_error_free(check_path_is_directory(paste0(pwd, "/")))
20})
21
22test_that("symlink to directory is directory", {
23  base <- dir_create(file_temp())
24  base_a <- dir_create(path(base, "a"))
25  base_b <- link_create(base_a, path(base, "b"))
26
27  expect_error_free(check_path_is_directory(base_b))
28})
29