tests/testthat/test-wt_data.R

context("wt_data")

test_that("wt_data returns the correct class", {
  skip_on_cran()

  prop <- "P846"
  aa <- wt_data("Mimulus foliatus", property = prop)

  expect_is(aa, "list")
  expect_is(aa$labels, "data.frame")
  expect_is(aa$descriptions, "data.frame")
  expect_is(aa$aliases, "data.frame")
  expect_is(aa$sitelinks, "data.frame")
  expect_is(aa$claims, "data.frame")
  expect_is(aa$claims, "data.frame")
  expect_equal(aa$claims$property, prop)
})

test_that("wt_data fails well", {
  expect_error(wt_data(), "argument \"x\" is missing, with no default")
})
ropenscilabs/wikitaxa documentation built on Oct. 19, 2018, 9:37 p.m.