Debian Codegraph @

tests/testthat/test-modify.R

raw
1
2 test_that("lockfiles can be modified non-interactively", {
3
4 skip_on_cran()
5 renv_tests_scope()
6 init()
7
8 modify(changes = list(R = list(Version = "1.0.0")))
9 lockfile <- renv_lockfile_load(project = getwd())
10 expect_equal(lockfile$R$Version, "1.0.0")
11
12 })
13
14 test_that("modifications that 'break' the lockfile are not persisted", {
15
16 skip_on_cran()
17 project <- renv_tests_scope()
18 init()
19
20 old <- renv_lockfile_load(project)
21 expect_error(modify(changes = list(Packages = 42)))
22 new <- renv_lockfile_load(project)
23 expect_equal(old, new)
24
25 })