Skip to content

Commit

Permalink
test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Dec 20, 2024
1 parent fc81299 commit c3c3de7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions renv.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: d504afbc-58f0-4895-98da-231731cf77be

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ test_that("we can install a version of renv with a sha", {

skip_on_cran()
skip_on_ci()
skip_if_no_github_auth()

renv_tests_scope()

Expand Down
14 changes: 7 additions & 7 deletions tests/testthat/test-dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ test_that("eval=<expr> is treated as truthy", {
})

test_that("piped expressions can be parsed for dependencies", {
deps <- dependencies("resources/magrittr.R")
deps <- dependencies(renv_tests_path("resources/magrittr.R"))
expect_setequal(deps$Package, c("A", "B", "C"))
})

Expand Down Expand Up @@ -606,16 +606,16 @@ test_that("dependencies() detects usages of Junit test reporters", {
})

test_that("dependencies() detects usage of ragg_png device", {

check <- function(document) {

file <- renv_scope_tempfile("renv-test-", fileext = ".R")
writeLines(document, con = file)

deps <- dependencies(file, quiet = TRUE)
expect_contains(deps$Package, "ragg")
}

check("opts_chunk$set(dev = \"ragg_png\")")
check("knitr::opts_chunk$set(dev = \"ragg_png\")")

Expand All @@ -639,14 +639,14 @@ test_that("renv infers a dev. dependency on lintr", {
})

test_that("https://github.com/rstudio/renv/issues/2052", {

renv_scope_tempdir()
dir.create("subdir")
writeLines("library(A)", con = "subdir/test.R")
writeLines(c("*", "!/**/", "!*.*"), con = ".renvignore")
deps <- dependencies(quiet = TRUE, root = getwd())
expect_contains(deps$Package, "A")

})

test_that("https://github.com/rstudio/renv/issues/2047", {
Expand Down

0 comments on commit c3c3de7

Please sign in to comment.