tests/testthat/test-chadwick_playerid_lookup.R

cols <- c(
  "first_name", "last_name", "given_name",
  "name_suffix", "nick_name", "birth_year",
  "mlb_played_first", "mlbam_id", "retrosheet_id",
  "bbref_id", "fangraphs_id"
)

test_that("Chadwick PlayerID Lookup", {
  skip_on_cran()
  
  x <- playerid_lookup("Garcia", "Karim")
  
  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.