tests/testthat/test_valid.R

context("Check for the valid function")

test_that("valid returns an empty list without internet", {
    .skip_if_misconfigured()

    result <- with_mock(
        `BiocManager:::.repositories_filter` = function(...) {
            ..1[FALSE]
        }, BiocManager::valid()
    )

    expect_true(
        is(result, "biocValid")
    )

    expect_identical(
        lengths(result),
        c(out_of_date = 0L, too_new = 0L)
    )
})

Try the BiocManager package in your browser

Any scripts or data that you put into this service are public.

BiocManager documentation built on June 16, 2021, 1:06 a.m.