tests/testthat/test_fars_data.R

context('Errors')


test_that('Throws errors', {
  throws_error(fars_read(filename = "an_other_inexistent_filename"))
  throws_error(fars_read_years(years = 3500))
  throws_error(fars_summarize_years(years = 25000))
  throws_error(make_filename(year = 'two thousand fourteen'))
})

context("File Loading")

testthat::test_that("make_filename", {
  result <- farsfun::make_filename(2017)
  testthat::expect_is(result, "character")
  testthat::expect_true(length(result) == 1)
})
Arcturio/mipqueteria documentation built on May 20, 2019, 3:33 p.m.