tests/testthat/test.nhl_url_players_stats.R

context("nhl_url_players_stats")

testthat::test_that(
  "nhl_url_players_stats generates 1 player url",
  testthat::expect_equal(
    nhl_url_players_stats(8477474),
    paste0(
      baseurl,
      "people/8477474/stats"
    )
  )
)

testthat::test_that(
  "nhl_url_players_stats generates 2 player url",
  testthat::expect_equal(
    nhl_url_players_stats(c(8477474, 8477475)),
    paste0(
      baseurl,
      c("people/8477474/stats", "people/8477475/stats")
    )
  )
)

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.