Skip to content

Commit 94c0d08

Browse files
committed
remove fs from tests
1 parent e8421df commit 94c0d08

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/testthat/test-03-db-generateCohortSet.R

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,19 @@ test_that("no error is given if attrition table already exists and overwrite = T
246246

247247
test_that("readCohortSet works from working directory", {
248248
skip("manual test") # seems to work as a standalone test but fails when running testtat
249-
skip_if_not_installed("fs")
250-
fs::dir_copy(system.file("cohorts1", package = "CDMConnector", mustWork = TRUE),
251-
file.path(tempdir(), "cohorts1"),
252-
overwrite = TRUE)
249+
250+
source_folder <- system.file("cohorts1", package = "CDMConnector", mustWork = TRUE)
251+
destination_folder <- file.path(tempdir(), "cohorts1")
252+
253+
if (!dir.exists(destination_folder)) {
254+
dir.create(destination_folder, recursive = TRUE)
255+
}
256+
257+
files <- list.files(source_folder, full.names = TRUE, recursive = TRUE)
258+
259+
file.copy(from = files,
260+
to = file.path(destination_folder, basename(files)),
261+
overwrite = TRUE)
253262

254263
withr::with_dir(tempdir(), {
255264
cohortSet <- readCohortSet("cohorts1")

0 commit comments

Comments
 (0)