tests/testthat/test_build_rates.R

context("Test build_rates") 

test_that("build_rates will fail if input is not of the correct type", {
  
  ## if the start.date or end.date is not Date type, there should be an error
  
  expect_error(build_rates(start.date = "2014-08-22", 
                           end.date = "2014-08-23"))
})

test_that("start date shouldn't be later than end date", {
  expect_error(build_rates(start.date = as.Date("2014-08-22"), 
                           end.date = as.Date("2014-08-21")))
})

Try the creditr package in your browser

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

creditr documentation built on May 29, 2017, 8:46 p.m.