diff --git a/tests/testthat/test-validate_pr.R b/tests/testthat/test-validate_pr.R index 57396e25..8316dd1b 100644 --- a/tests/testthat/test-validate_pr.R +++ b/tests/testthat/test-validate_pr.R @@ -1,7 +1,8 @@ test_that("validate_pr works on valid PR", { skip_if_offline() - temp_hub <- fs::path(tempdir(), "valid_sb_hub") + dir <- withr::local_tempdir() + temp_hub <- fs::dir_create(fs::path(dir, "valid_sb_hub")) gert::git_clone( url = "https://github.com/hubverse-org/ci-testhub-simple", path = temp_hub, @@ -27,7 +28,8 @@ test_that("validate_pr works on valid PR", { test_that("validate_pr works on invalid PR", { skip_if_offline() - temp_hub <- fs::path(tempdir(), "invalid_sb_hub") + dir <- withr::local_tempdir() + temp_hub <- fs::dir_create(fs::path(dir, "invalid_sb_hub")) gert::git_clone( url = "https://github.com/hubverse-org/ci-testhub-simple", path = temp_hub, @@ -53,7 +55,8 @@ test_that("validate_pr works on invalid PR", { test_that("validate_pr flags modifications and deletions in PR", { skip_if_offline() - temp_hub <- fs::path(tempdir(), "mod_del_hub") + dir <- withr::local_tempdir() + temp_hub <- fs::dir_create(fs::path(dir, "mod_del_hub")) gert::git_clone( url = "https://github.com/hubverse-org/ci-testhub-simple", path = temp_hub, @@ -140,7 +143,8 @@ test_that("validate_pr flags modifications and deletions in PR", { test_that("validate_pr handles errors in determining submission window & file renaming", { skip_if_offline() - temp_hub <- fs::path(tempdir(), "mod_exec_error_hub") + dir <- withr::local_tempdir() + temp_hub <- fs::dir_create(fs::path(dir, "mod_exec_error_hub")) gert::git_clone( url = "https://github.com/hubverse-org/ci-testhub-simple", path = temp_hub, @@ -165,7 +169,8 @@ test_that("validate_pr handles errors in determining submission window & file re test_that("validate_pr works on valid PR using v2.0.0 schema and old orgname", { skip_if_offline() - temp_hub <- fs::path(tempdir(), "valid_sb_hub-old") + dir <- withr::local_tempdir() + temp_hub <- fs::dir_create(fs::path(dir, "valid_sb_hub-old")) gert::git_clone( url = "https://github.com/hubverse-org/ci-testhub-simple-old-orgname", path = temp_hub,