tests/testthat/test-get_recently_committees.R

context("get_recently_committees")

test_that("expected errors", {
  expect_warning(expect_error(get_recently_committees(16), "Incorrect cycle"), "Cycle should be four-digit year")
  expect_warning(expect_error(get_recently_committees(1995), "Incorrect cycle"), "Cycle should be four-digit year larger than 1996")
  expect_warning(expect_error(get_recently_committees(1999), "Incorrect cycle"), "Cycle should be even-numbered year larger than 1996")
})

test_that("expected lengths", {
  expect_length(get_recently_committees(1996), 3)
})

Try the ProPublicaR package in your browser

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

ProPublicaR documentation built on Sept. 8, 2023, 5:53 p.m.