Skip to content

Commit

Permalink
no more withr
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Rodrigues committed Jan 30, 2024
1 parent b785620 commit 01c046b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ Imports:
httr,
jsonlite,
sys,
utils,
withr
utils
Suggests:
knitr,
rmarkdown,
Expand Down
2 changes: 1 addition & 1 deletion R/with_nix.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ with_nix <- function(expr,

# 1) save all function args onto a temporary folder each with
# `<tag.Rds>` and `value` as serialized objects from RAM ---------------------
temp_dir <- withr::local_tempdir()
temp_dir <- tempdir()
serialize_args(args, temp_dir)

# cast list of symbols/names and calls to list of strings; this is to prepare
Expand Down
4 changes: 2 additions & 2 deletions dev/flat_rix.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ flag_rpkgs
```{r, tests-rix}
testthat::test_that("Snapshot test of rix()", {
path_default_nix <- withr::local_tempdir()
path_default_nix <- tempdir()
save_default_nix_test <- function(ide, path_default_nix) {
Expand Down Expand Up @@ -447,7 +447,7 @@ testthat::test_that("Snapshot test of rix()", {
```{r, tests-add_quarto_to_sys_pkgs}
testthat::test_that("Quarto gets added to sys packages", {
path_default_nix <- withr::local_tempdir()
path_default_nix <- tempdir()
save_default_nix_test <- function(pkgs, path_default_nix) {
Expand Down
2 changes: 1 addition & 1 deletion dev/flat_rix_init.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ nix_rprofile <- function() {
```{r, tests-rix_init}
testthat::test_that("Snapshot test of rix_init()", {
path_env_nix <- withr::local_tempdir()
path_env_nix <- tempdir()
save_rix_init_test <- function(path_env_nix) {
Expand Down
6 changes: 3 additions & 3 deletions dev/flat_with_nix.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ with_nix <- function(expr,
# 1) save all function args onto a temporary folder each with
# `<tag.Rds>` and `value` as serialized objects from RAM ---------------------
temp_dir <- withr::local_tempdir()
temp_dir <- tempdir()
serialize_args(args, temp_dir)
# cast list of symbols/names and calls to list of strings; this is to prepare
Expand Down Expand Up @@ -845,7 +845,7 @@ testthat::test_that("Testing `with_nix()` if Nix is installed", {
#skip_on_covr()
path_subshell <- withr::local_tempdir()
path_subshell <- tempdir()
rix_init(
project_path = path_subshell,
Expand Down Expand Up @@ -884,7 +884,7 @@ testthat::test_that("Test `with_nix()` if Nix is installed on R 4.2.0", {
skip_if_not(nix_shell_available())
path_subshell <- withr::local_tempdir()
path_subshell <- tempdir()
rix_init(
project_path = path_subshell,
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-rix.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

testthat::test_that("Snapshot test of rix()", {

path_default_nix <- withr::local_tempdir()
path_default_nix <- tempdir()

save_default_nix_test <- function(ide, path_default_nix) {

Expand Down Expand Up @@ -56,7 +56,7 @@ testthat::test_that("Snapshot test of rix()", {

testthat::test_that("Quarto gets added to sys packages", {

path_default_nix <- withr::local_tempdir()
path_default_nix <- tempdir()

save_default_nix_test <- function(pkgs, path_default_nix) {

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-rix_init.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

testthat::test_that("Snapshot test of rix_init()", {

path_env_nix <- withr::local_tempdir()
path_env_nix <- tempdir()

save_rix_init_test <- function(path_env_nix) {

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-with_nix.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ testthat::test_that("Testing `with_nix()` if Nix is installed", {

#skip_on_covr()

path_subshell <- withr::local_tempdir()
path_subshell <- tempdir()

rix_init(
project_path = path_subshell,
Expand Down Expand Up @@ -47,7 +47,7 @@ testthat::test_that("Test `with_nix()` if Nix is installed on R 4.2.0", {

skip_if_not(nix_shell_available())

path_subshell <- withr::local_tempdir()
path_subshell <- tempdir()

rix_init(
project_path = path_subshell,
Expand Down

0 comments on commit 01c046b

Please sign in to comment.