tests/testthat/test.nhl_url_players_allseasons.R

context("nhl_url_players_allseasons")

testthat::test_that(
  "nhl_url_players_allseasons generates for 2 players",
  testthat::expect_equal(
    nhl_url_players_allseasons(c(8477474, 8477475)),
    paste0(
      baseurl,
      c(
        "people/8477474/stats?stats=yearByYear",
        "people/8477475/stats?stats=yearByYear"
      )
    )
  )
)

Try the nhlapi package in your browser

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

nhlapi documentation built on Feb. 20, 2021, 9:06 a.m.