Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics committed Mar 2, 2023
1 parent d61d2ee commit a47fef5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/testthat/test_expost_rang.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,21 @@ test_that("prevent infinite loop, #81", {
graph$ranglets[[1]]$original$y_pkgref <- "bioc::S4Vectors"
expect_error(.generate_installation_order(graph), "cran::LDAvis")
})

test_that("renv export", {
temp_dir <- tempdir()
graph <- readRDS("../testdata/rang_ok.RDS")
export_renv(graph, path = temp_dir)
x <- readLines(file.path(temp_dir,"renv.lock"))
expect_true(any(grepl("LDAvis",x)))
expect_true(any(grepl("proxy",x)))
expect_true(any(grepl("RJSONIO",x)))
})

test_that("empty renv export", {
graph <- readRDS("../testdata/rang_ok.RDS")
graph$ranglets <- list()
expect_warning(x <- export_rang(graph, path = tempfile()))
expect_equal(x, NULL)
})

0 comments on commit a47fef5

Please sign in to comment.