Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Sep 9, 2023
1 parent 231afb9 commit dba0079
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ renv_zzz_load <- function() {
# make sure renv (and packages using renv!!!) use tempdir for storage
# when running tests, or R CMD check
if (checking() || testing()) {
Sys.setenv(RENV_PATHS_ROOT = tempfile("renv-root-"))
Sys.setenv(RENV_PATHS_SANDBOX = tempfile("renv-sandbox-"))
Sys.setenv(RENV_PATHS_ROOT = Sys.getenv("RENV_PATHS_ROOT", unset = tempfile("renv-root-")))
Sys.setenv(RENV_PATHS_SANDBOX = Sys.getenv("RENV_PATHS_SANDBOX", unset = tempfile("renv-sandbox-")))
options(renv.sandbox.locking_enabled = FALSE)
}

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-autoload.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ test_that("autoload() works", {
# launch R and see what library paths we got
output <- renv_system_exec(
command = R(),
args = c("-s", "-e", renv_shell_quote("writeLines(.libPaths())")),
args = c("-s", "-e", renv_shell_quote("writeLines(.libPaths()[1])")),
action = "testing autoload"
)

expected <- .libPaths()
expected <- .libPaths()[1]
expect_equal(tail(output, n = length(expected)), expected)

})
2 changes: 1 addition & 1 deletion tests/testthat/test-migrate.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ skip_if_no_packrat <- function() {
skip("cannot test with development version of Packrat")

packrat <- renv_available_packages_latest(package = "packrat", type = "source")
if (packageVersion("packrat") > packrat$Version)
if (packageVersion("packrat") != packrat$Version)
skip("packrat is not current")

TRUE
Expand Down

0 comments on commit dba0079

Please sign in to comment.