tests/testthat/test_install_formats.R

context("Install uninstalled formats")

test_that("uninstalled_formats()", {
    skip_on_cran()
    formats <- uninstalled_formats()
    if (is.null(formats)) {
        expect_true(install_formats())
    } else {
        expect_type(formats, "character")
    }
})

test_that("install_formats()", {
    suggestions <- read.dcf(system.file("examples/example-DESCRIPTION",
                                        package = "rio", mustWork = TRUE),
                            fields = "Suggests")
    suggestions <- parse_suggestions(suggestions)
    expect_true("NANTUCKET" %in% suggestions)
    expect_true("readODS" %in% suggestions)
    expect_false("devtools" %in% suggestions)
})

Try the rio package in your browser

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

rio documentation built on Nov. 22, 2021, 9:07 a.m.