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-build-github.R
test_that("a CNAME record is built if a url exists in metadata", {
cname <- test_path("assets/cname")
dir_create(path(cname, "docs"))
on.exit({
clean_site(cname)
file_delete(path(cname, "docs", "CNAME"))
file_delete(path(cname, "docs", ".nojekyll"))
})
expect_output(build_github_pages(cname))
expect_equal(read_lines(path(cname, "docs", "CNAME")), "testpackage.r-lib.org")
})
test_that("CNAME URLs are valid", {
expect_equal(cname_url("http://google.com/"), "google.com")
expect_equal(cname_url("https://google.com/"), "google.com")
# this is not a valid URL because it has a trailing path
expect_null(cname_url("http://google.com/path/"))
})