tests/testthat/test_release_status.R

context("release status")

test_that("returns compile when present", {
  expect_equal(any(grepl("compile", release_status("release-status-compile.tex"))), TRUE)
})

test_that("returns pre_release when present", {
  expect_equal(any(grepl("pre_release", release_status("release-status-compile.tex"))), TRUE)
})

test_that("returns release when present", {
  expect_equal(any(grepl("^release", release_status("release-status-compile.tex"))), TRUE)
})

test_that("Release even if trailing whitespace", {
  expect_equal(release_status("release-status-compile-ws.tex"),
               c("compile"))
})

test_that("returns NULL when no directive present", {
  expect_null(release_status("release-status-no-directive.tex"))
})
HughParsonage/grattanReporter documentation built on May 7, 2019, 5:02 a.m.