## load packages

context("Run Neotoma examples only when not on CRAN")

test_that("Examples run without error", {
    ## we don't want this to run on CRAN

    ## List of example topics we want to check
    egs <- c('compile_downloads',

    refnames <- paste0("example-ref-", egs, ".rds")

    for (i in seq_along(egs)) {
        # Testing each of the example codes, by `topic`.  
        egout <- try(example(topic = egs[i], package = "neotoma", ask = FALSE,
                             character.only = TRUE, run.dontrun = TRUE,
                             echo = TRUE))
        #expect_that(inherits(egout, "try-error"), is_false(),
        #            label = paste("Error raised in example:", egs[i]))
        #expect_that(egout, equals_reference(refnames[i]))

Try the neotoma package in your browser

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

neotoma documentation built on June 23, 2017, 4:44 a.m.