tests/testthat/test-scrape_rba_forecasts.R

test_that("scrape_rba_forecasts() returns expected output", {
  skip_if_offline()
  skip_on_cran()

  forecasts <- scrape_rba_forecasts()

  expect_is(forecasts, "tbl_df")
  expect_length(forecasts, 8)
  expect_gt(nrow(forecasts), 800)
  expect_false(any(is.na(forecasts$value)))
  expect_is(forecasts$value, "numeric")
  expect_lt(
    Sys.Date() - max(forecasts$forecast_date),
    120
  )
})

Try the readrba package in your browser

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

readrba documentation built on Aug. 13, 2023, 9:06 a.m.