tests/testthat/test-fail-internals.R

context("fail-internals")

test_that("ntwd_tf", {
  skip_if_offline()
  skip_if_http_error()

  expect_identical(
    attr(ntwd_tf(1), "source"),
    "https://www.nationwide.co.uk/-/media/MainSite/documents/about/house-price-index/downloads/monthly.xls"
  )
  # expect_identical(
  #   catch_message(ntwd_tf(1, access_info = TRUE)),
  #   "Accessing https://www.nationwide.co.uk/-/media/MainSite/documents/about/house-price-index/downloads/monthly.xls\n"
  # )
  # expect_message(
  #   ntwd_tf(40),
  #   "Could not resolve host: NA"
  #   )
})

Try the nationwider package in your browser

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

nationwider documentation built on April 14, 2020, 5:12 p.m.