tests/testthat/test-helpers.R

test_that("choose season returns a character representation of a year", {
  expect_type(.fn_choose_season(), "character")
  expect_equal(.fn_choose_season("2020-03-01"), "2020")
  expect_equal(.fn_choose_season("2020-02-01"), "2019")
})

test_that(".fn_set_ratelimit creates a 'GET' function", {
  local_mock_api()

  expect_is(.fn_set_ratelimit(TRUE, "MFL", 1, 1)$get("http://httpbin.org"), "response")
  expect_is(.fn_set_ratelimit(FALSE, "MFL")$get("http://httpbin.org"), "response")
})

Try the ffscrapr package in your browser

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

ffscrapr documentation built on Feb. 16, 2023, 10:55 p.m.