tests/testthat/test-standalone.R

test_that("gitcreds is standalone", {
  stenv <- environment(gitcreds_get)
  objs <- ls(stenv, all.names = TRUE)
  funs <- Filter(function(x) is.function(stenv[[x]]), objs)
  funobjs <- mget(funs, stenv)
  for (f in funobjs) expect_identical(environmentName(topenv(f)), "base")

  skip_if_not_installed("codetools")
  expect_message(
    mapply(
      codetools::checkUsage,
      funobjs,
      funs,
      MoreArgs = list(report = message)
    ),
    NA
  )
})
r-lib/gitcreds documentation built on June 10, 2025, 10:24 p.m.