tests/testthat/test-get_recent_late_contributions.R

context("get_recent_late_contributions")

test_that("testing cycle argument", {
  year <- seq(1996,2018)
  expect_error(get_recent_late_contributions(year[1],"Cycle must be even-numbered year between 2010 and 2018"))
  expect_length(get_recent_late_contributions(year[15]), 7)
  expect_warning(expect_error(get_recent_late_contributions(year[2]), "Incorrect cycle"), "Cycle should be even-numbered year larger than 1996")
  expect_warning(expect_error(get_recent_late_contributions(0), "Incorrect cycle"), "Cycle should be four-digit year")
})

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.