tests/testthat/test-ebirdregion.R

context("ebirdregion")

test_that("ebirdregion works correctly", {
  skip_on_cran()
  
  out <- ebirdregion(loc = 'US', species = 'btbwar', max = 50)
  expect_is(out, "data.frame")
  expect_equal(ncol(out), 13)
  expect_is(out$comName, "character")
  expect_is(out$howMany, "integer")

  expect_equal(dim(ebirdregion('US-OH', max=10, provisional=TRUE, hotspot=TRUE)), c(10,13))
  
  res <- ebirdregion(loc = 'US-CA', max = 10)
  expect_equal(ncol(res), 13)
  
  expect_equal(ncol(ebirdregion(loc = 'US', species = 'coohaw')), 13)
  expect_gte(ncol(ebirdregion(loc = 'L109339', species = 'amecro', simple = FALSE)), 26)
})

Try the rebird package in your browser

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

rebird documentation built on Sept. 20, 2021, 9:06 a.m.