tests/testthat/test-mlb_pitch_codes.R

cols <- c(
  "pitch_code",
  "pitch_description",
  "swing_status",
  "swing_miss_status",
  "swing_contact_status",
  "sort_order",
  "strike_status",
  "ball_status",
  "pitch_status",
  "pitch_result_text"
)

test_that("MLB Pitch Codes", {
  skip_on_cran()
  
  x <- mlb_pitch_codes()
  
  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.