tests/testthat/test-committee_report.R

with_mock_dir("t/report", {
  test_that("cong_committee_report works", {
    x <- cong_committee_report()
    expect_s3_class(x, 'tbl_df')
  })
})

with_mock_dir("t/report1", {
  test_that("cong_committee_report with item works", {
    x <- cong_committee_report(congress = 116, type = 'hrpt', number = 617, item = 'text')
    expect_s3_class(x, 'tbl_df')
  })
})

with_mock_dir("t/report2", {
  test_that("cong_committee_report without item works", {
    x <- cong_committee_report(congress = 116, type = 'hrpt', number = 617)
    expect_s3_class(x, 'tbl_df')
  })
})

Try the congress package in your browser

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

congress documentation built on May 29, 2024, 2:37 a.m.