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")

  expect_message(
    mapply(codetools::checkUsage, funobjs, funs,
           MoreArgs = list(report = message)),
    NA)
})
r-lib/gitcreds documentation built on Nov. 9, 2023, 5:43 p.m.