tests/testthat/test-settings.R

test_that(".substitute_altdoc_vars removes github if no url", {
  create_local_package()
  desc::desc_set_urls("https://foobar.com")
  setup_docs("docute")
  render_docs()
  content <- .readlines("docs/index.html")
  expect_false(any(grepl("$ALTDOC_PACKAGE_URL_GITHUB", content, fixed = TRUE)))
})

test_that(".substitute_altdoc_vars removes website if no url", {
  create_local_package()
  desc::desc_set_urls("https://github.com/foo/bar")
  setup_docs("docute")
  render_docs()
  content <- .readlines("docs/index.html")
  expect_false(any(grepl("$ALTDOC_PACKAGE_URL", content, fixed = TRUE)))
})

Try the altdoc package in your browser

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

altdoc documentation built on April 3, 2025, 10:52 p.m.