swh:1:snp:bdc19e867479541d0f4994ceaa711217d0dc28ed
Tip revision: 1ad2332a4119217014f512bdf05025fa6f2bb72f authored by Hadley Wickham on 09 April 2020, 13:00:02 UTC
version 1.5.1
version 1.5.1
Tip revision: 1ad2332
test-deploy-site.R
# ci_commit_sha() ------------------------------------------------------------
test_that("commit sha can be retrieved from travis or GitHub action env vars", {
sha <- "XYZ"
withr::with_envvar(
c("TRAVIS_COMMIT" = sha, "GITHUB_SHA" = ""),
expect_equal(ci_commit_sha(), sha)
)
withr::with_envvar(
c("TRAVIS_COMMIT" = "", "GITHUB_SHA" = sha),
expect_equal(ci_commit_sha(), sha)
)
withr::with_envvar(
c("TRAVIS_COMMIT" = "", "GITHUB_SHA" = ""),
expect_equal(ci_commit_sha(), "")
)
})