tests/testthat/test-mlb_game_status_codes.R

cols <- c(
  "abstract_game_state", "coded_game_state",
  "detailed_state", "status_code", "reason", "abstract_game_code"
)

test_that("MLB Game Status Codes", {
  skip_on_cran()
  
  x <- mlb_game_status_codes() %>% 
    dplyr::select(tidyr::all_of(cols))
  
  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.