tests/testthat/test-use-cran-comments.R

context("use-cran-comments")

test_that("use_cran_comments() requires a package", {
  scoped_temporary_project()
  expect_usethis_error(use_cran_comments(), "not an R package")
})

test_that("use_cran_comments() creates and ignores the promised file", {
  scoped_temporary_package()
  use_cran_comments()
  expect_proj_file("cran-comments.md")
  expect_true(is_build_ignored("^cran-comments\\.md$"))
})

Try the usethis package in your browser

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

usethis documentation built on July 4, 2019, 5:05 p.m.