tests/testthat/test-mlb_awards_recipient.R

cols <- c(
  "award_id", "award_name", "date", "season", "votes", 
  "notes", "player_id", "player_link", "player_name_first_last",
  "player_primary_position_code", "player_primary_position_name",
  "player_primary_position_type", 
  "player_primary_position_abbreviation", "team_id", "team_link"
)

test_that("MLB Awards recipients", {
  skip_on_cran()
  
  x <- mlb_awards_recipient(award_id = 'MLBHOF', season = 2020)
  
  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.