tests/testthat/test-pub_sections.R

context("pub_sections")

test_that("pub_sections works", {
  expect_is(pub_sections(), "character")
  expect_true(any(grepl("title", pub_sections())))
  expect_true(any(grepl("publisher", pub_sections())))
  expect_true(any(grepl("history", pub_sections())))
})

test_that("pub_sections fails well", {
  expect_error(pub_sections(5), "unused argument")
})
ropensci/pubchunks documentation built on Sept. 14, 2022, 7:48 a.m.