tests/testthat/test_get_boxscore_links.R

context('Check that boxscore links are scraped properly')

test_that('Number of NFL links scraped is correct', {
    # whole season
    links <- get_nfl_boxscore_links(year = 2012)
    expect_equal(length(links), 256)

    # one week
    links <- get_nfl_boxscore_links(year = 2012, week = 1)
    expect_equal(length(links), 16)
})
kimjam/dfstoolkit documentation built on May 20, 2019, 9:40 a.m.