tests/testthat/test-securitytxt.R

context("core functionality")
test_that("extraction and validation work", {

  x <- sectxt(readLines(system.file("extdata", "security.txt", package="securitytxt")))

  expect_that(x, is_a("sectxt"))
  expect_that(sectxt_info(x), is_a("data.frame"))
  expect_equal(sectxt_info(x)$key, c("contact", "encryption"))
  expect_true(sectxt_validate(x))
  expect_equal(sectxt_url("https://securitytxt.org/this/that/the/other.html"),
               "https://securitytxt.org/.well-known/security.txt")

})

Try the securitytxt package in your browser

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

securitytxt documentation built on Aug. 19, 2019, 5:03 p.m.