tests/testthat/test_constituencies.R

library(hansard)
context("constituencies")

test_that("constituencies functions return expected format", {
  skip_on_cran()
  skip_if(Sys.getenv(x = "TRAVIS_R_VERSION_STRING") == "devel")

  ctx <- hansard_constituencies(current = TRUE, verbose = TRUE)
  expect_length(ctx, 7)
  expect_true(tibble::is_tibble(ctx))
  expect_equal(nrow(ctx), 650)
  expect_true(names(ctx)[6] == "started_date_value")
})
EvanOdell/hansard documentation built on Oct. 12, 2021, 11:29 p.m.