tests/testthat/test-module.R

source("../fns.R")

test_that("update", {
  wd <- getwd()
  pkg <- create_tmp_package()
  setwd(pkg)
  on.exit({
    setwd(wd)
    delete_tmp_package(pkg)
  })

  expect_error(add_module())
  scaffold()
  expect_error(add_module())
  expect_error(add_module("err or"))
  expect_message(add_module("mod"))
})

Try the leprechaun package in your browser

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

leprechaun documentation built on Jan. 19, 2022, 5:08 p.m.