| 1 |
|
| 2 |
test_that("renv can find packages located in the cellar", { |
| 3 |
skip_on_cran() |
| 4 |
renv_tests_scope() |
| 5 |
|
| 6 |
# copy some packages into the cellar |
| 7 |
cellar <- renv_paths_cellar() |
| 8 |
ensure_directory(cellar) |
| 9 |
|
| 10 |
repopath <- renv_tests_repopath() |
| 11 |
packages <- list.files( |
| 12 |
path = file.path(repopath, "src/contrib"), |
| 13 |
pattern = ".tar.gz$", |
| 14 |
full.names = TRUE |
| 15 |
) |
| 16 |
|
| 17 |
file.copy(packages, to = cellar) |
| 18 |
|
| 19 |
# turn off repositories |
| 20 |
renv_scope_options(repos = character()) |
| 21 |
|
| 22 |
# check for latest available package |
| 23 |
latest <- renv_available_packages_latest("bread", type = "source") |
| 24 |
expect_equal( |
| 25 |
latest[c("Package", "Version")], |
| 26 |
list(Package = "bread", Version = "1.0.0") |
| 27 |
) |
| 28 |
|
| 29 |
# check that we can install it |
| 30 |
install("bread") |
| 31 |
|
| 32 |
}) |