context("Snapshot")
test_that("snapshot failures are reported", {
renv_scope_envvars(RENV_PATHS_ROOT = tempfile())
renv_tests_scope("oatmeal")
renv::init()
descpath <- system.file("DESCRIPTION", package = "oatmeal")
unlink(descpath)
output <- tempfile("renv-snapshot-output-")
local({
renv_scope_sink(file = output)
renv::snapshot(confirm = FALSE)
})
contents <- readLines(output)
expect_true(length(contents) > 1)
})
test_that("broken symlinks are reported", {
skip_on_os("windows")
renv_scope_envvars(RENV_PATHS_ROOT = tempfile())
renv_tests_scope("oatmeal")
renv::init()
oatmeal <- normalizePath(system.file(package = "oatmeal"), winslash = "/")
unlink(oatmeal, recursive = TRUE)
output <- tempfile("renv-snapshot-output-")
local({
renv_scope_sink(file = output)
renv::snapshot(confirm = FALSE)
})
contents <- readLines(output)
expect_true(length(contents) > 1)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.