tests/testthat/test-ifo.R

test_that("ifo_url() returns expected result", {
  local_mocked_bindings(
    read_html = \(x) rvest::read_html(test_path("fixtures", "ifo-time-series.html"))
  )
  expected <- "https://www.ifo.de/sites/default/files/secure/timeseries/gsk-e-202505.xlsx" # nolint
  expect_identical(ifo_url("germany"), expected)
  expect_identical(ifo_url("sectors"), expected)
  types <- c(
    "germany",
    "sectors",
    "eastern",
    "saxony",
    "export",
    "employment",
    "export_climate",
    "import_climate"
  )
  lapply(types, \(type) expect_length(ifo_url(type), 1L))
})

Try the ifo package in your browser

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

ifo documentation built on June 8, 2025, 10:39 a.m.