tests/testthat/test-repos_available.R

r <- getOption("repos")
r["CRAN"] <- "https://cran.r-project.org"
r["RSPM"] <- "https://packagemanager.rstudio.com/cran/latest"
options(repos=r)

test_that("check repo checking works", {
  # Tell envstat to not check if repos are available
  config <- list(repos_available = FALSE)
  # Run the tests
  testthat::expect_true(envstat:::check_repos_available(config, silent = TRUE))
})

Try the envstat package in your browser

Any scripts or data that you put into this service are public.

envstat documentation built on June 14, 2022, 5:06 p.m.