tests/testthat/test-ncaa_roster.R

cols <- c(
  "player_name",
  "class",
  "player_id",
  "season",
  "number",
  "position",
  "player_url",
  "team_id",
  "team_name",
  "team_url",
  "conference_id",
  "conference",
  "division",
  "year",
  "season_id"
)

test_that("NCAA Roster", {
  skip_on_cran()
  x <- ncaa_roster(team_id = 104, year = 2019)
  
  expect_equal(colnames(x), cols)
  expect_s3_class(x, "data.frame")
})

Try the baseballr package in your browser

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

baseballr documentation built on April 1, 2023, 12:12 a.m.