Debian Codegraph @

tests/testthat/test-packages.R

raw
1
2 test_that("remote field updates are written to both DESCRIPTION, packages.rds", {
3
4 url <- renv_tests_path("local/skeleton/skeleton_1.0.1.tar.gz")
5
6 record <- list(
7 Package = "skeleton",
8 Version = "1.0.1",
9 Source = "local",
10 RemoteUrl = url
11 )
12
13 renv_tests_scope()
14 renv_scope_envvars(RENV_PATHS_LOCAL = NULL)
15 install(packages = list(record))
16
17 pkgpath <- renv_package_find("skeleton")
18
19 descpath <- file.path(pkgpath, "DESCRIPTION")
20 desc <- renv_description_read(descpath)
21
22 metapath <- file.path(pkgpath, "Meta/package.rds")
23 meta <- as.list(readRDS(metapath)$DESCRIPTION)
24
25 expect_true(desc$RemoteType == "local")
26 expect_true(meta$RemoteType == "local")
27
28 expect_true(desc$RemoteUrl == url)
29 expect_true(meta$RemoteUrl == url)
30
31 })