tests/testthat/test_update_contributing.R

# Attach packages and set up with temporary directory
library(NVIpackager)
td <- tempdir()

if (!dir.exists(file.path(td, "NVItest"))) {
  dir.create(file.path(td, "NVItest"))
}
if (!dir.exists(file.path(td, "NVItest", "vignettes"))) {
  dir.create(file.path(td, "NVItest", "vignettes"))
}

test_that("Update contributing", {

  update_contributing(pkg = "NVItest", pkg_path = file.path(td, "NVItest"))

  expect_true(file.exists(paste0(td, "/NVItest/vignettes/Contribute_to_NVItest.Rmd")))

  expect_true(file.exists(paste0(td, "/NVItest/CONTRIBUTING.md")))
})
PetterHopp/NVIpackager documentation built on Sept. 14, 2024, 1:24 a.m.