tests/testthat/test-cfbd_team_info.R

cols <- c(
  "team_id", "school", "mascot", "abbreviation", "alt_name1", "alt_name2",
  "alt_name3", "conference", "division", "classification",
  "color", "alt_color", "logo", "logo_2", "twitter", "venue_id", "venue_name",
  "city", "state", "zip", "country_code", "timezone",
  "latitude","longitude","elevation",
  "capacity", "year_constructed", "grass", "dome")

test_that("CFB Team Info", {
  skip_on_cran()
  x <- cfbd_team_info(year = 2019)
  if (is.null(x) || !is.data.frame(x) || nrow(x) == 0L) {
    skip("CFBD rate-limited or returned no rows")
  }

  expect_equal(nrow(x), 130)
  # Subset direction (expected subset of actual), per the repo convention:
  # CFBD adds columns over time and an exact set/count assertion turns that
  # into a red build for a change that broke nothing.
  expect_gte(ncol(x), length(cols))
  expect_in(cols, colnames(x))
  expect_s3_class(x, "data.frame")
})

Try the cfbfastR package in your browser

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

cfbfastR documentation built on Aug. 24, 2026, 5:13 p.m.