tests/testthat/test-github-issue.R

library(testthat)
library(gluedown)
library(stringr)
library(rvest)
library(knitr)
library(glue)

test_that("md_issue creates GitHub auto-link URL", {
  issue <- md_issue("kiernann/gluedown", 1)
  convert <- str_c("https://github.com/", str_replace(issue, "#", "/issues/"))
  url <- "https://github.com/kiernann/gluedown/issues/1"
  expect_equal(convert, url)
})

test_that("md_issue returns error without issue number", {
  expect_error(md_issue("kiernann/gluedown", "one"))
})

test_that("md_issue returns error without correct repo format", {
  expect_warning(md_issue("gluedown", 1))
})

Try the gluedown package in your browser

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

gluedown documentation built on Nov. 2, 2023, 5:48 p.m.