tests/testthat/testZoonCitation.R

context("ZoonCitation")

test_that("Check error if not found", {
  skip_on_cran()

  expect_error(
    ZoonCitation("ThisDoesNotExist"),
    "URL for module does not exist"
  )
})

test_that("Check returns list with all the names", {
  x <- ZoonCitation("LogisticRegression")

  names <- c(
    "title", "name", "authors",
    "date_submitted", "note", "email",
    "url"
  )

  expect_named(x, names)
})

Try the zoon package in your browser

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

zoon documentation built on Feb. 28, 2020, 5:09 p.m.