tests/testthat/test-environment.R

context("function")

test_that("function", {
  expect_error(check_environment(1), "1 must be an environment")
  expect_identical(check_environment(.GlobalEnv), .GlobalEnv)
})

Try the checkr package in your browser

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

checkr documentation built on May 1, 2019, 6:59 p.m.