tests/testthat/test-guess_url.R

context("guess_url")

test_that("guessing URLs works", {
  urls <- c(
    "example.cybozu.com",
    "http://example.cybozu.com",
    "https://example.cybozu.com",
    "https://example.cybozu.com/",
    "https://example.cybozu.com/k/v1"
    )

  expect_true(
    all(
      purrr::map_chr(urls, guess_url) == "https://example.cybozu.com/"
    )
  )
})

Try the kntnr package in your browser

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

kntnr documentation built on April 14, 2020, 5:36 p.m.