Skip to content

Commit d43ff2f

Browse files
committed
stricter cleanup of temporary directory
1 parent ffd25a4 commit d43ff2f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/testthat/test_rotate_date.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ test_that("backup/rotate_time works to different directory", {
365365
tf <- file.path(td, "test.log")
366366
bu_dir <- file.path(td, "backups")
367367
dir.create(bu_dir)
368-
on.exit(unlink(c(bu_dir, tf)))
368+
on.exit(unlink(c(tf, bu_dir), recursive = TRUE))
369369

370370
file.create(tf)
371371
writeLines("foobar", tf)
@@ -390,7 +390,7 @@ test_that("backup/rotate_time works with custom format", {
390390
tf <- file.path(td, "test.log")
391391
bu_dir <- file.path(td, "backups")
392392
dir.create(bu_dir)
393-
on.exit(unlink(c(bu_dir, tf)))
393+
on.exit(unlink(c(tf, bu_dir), recursive = TRUE))
394394

395395
file.create(tf)
396396
writeLines("foobar", tf)

tests/testthat/test_rotate_time.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ test_that("backup/rotate date works to different directory", {
8787
tf <- file.path(td, "test.log")
8888
bu_dir <- file.path(td, "backups")
8989
dir.create(bu_dir)
90-
on.exit(unlink(c(bu_dir, tf)))
90+
on.exit(unlink(c(tf, bu_dir), recursive = TRUE))
9191

9292
file.create(tf)
9393
writeLines("foobar", tf)

0 commit comments

Comments
 (0)