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("k5cents/gluedown", 1)
  convert <- str_c("https://github.com/", str_replace(issue, "#", "/issues/"))
  url <- "https://github.com/k5cents/gluedown/issues/1"
  expect_equal(convert, url)
})

test_that("md_issue returns error without issue number", {
  expect_error(md_issue("k5cents/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 May 29, 2024, 11:42 a.m.