tests/testthat/test-workhorse.R

test_that(
  "argument errors work: spatial", {

    expect_error(voters::getPS(spatial = "yes"),
                 regexp = "Invalid 'spatial' argument provided. Must be logical")

  }
)


test_that(
  "argument errors work: spatial", {

    expect_error(voters::getPS(spatial = 2),
                 regexp = "Invalid 'spatial' argument provided. Must be logical")


  }
)


test_that(
  "argument errors work: id", {

    expect_error(voters::getPS(id = "yes"),
                 regexp = "Invalid 'id' argument provided. Must be logical")

  }
)

test_that(
  "argument errors work: id", {

    expect_error(voters::getPS(id = 2),
                 regexp = "Invalid 'id' argument provided. Must be logical")


  }
)
jvieroe/voters documentation built on Feb. 5, 2022, 5:22 p.m.