tests/testthat/test-utils.R

context("test-utils")

test_that("require arguments", {
  x <- "text"
  expect_silent(check_required_args(x, "character"))
  expect_error(check_required_args(x, "numeric"))
  expect_error(check_required_args(x, "a"))
  expect_error(check_required_args(1L, "data.frame"))
  expect_error(check_required_args(type = "list"))
})

Try the shutterstock package in your browser

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

shutterstock documentation built on May 1, 2019, 6:57 p.m.