tests/testthat/test-dont_ask.R

context("dont_ask")

test_that("dont_ask returns current GUI state", {
  expect_identical(dont_ask(), !interactive() || !gui_ask(gui))
  expect_error(
    if (interactive()) dont_ask(gui = "noGUI") else
      stop("'gui' object 'noGUI' not found"),
    "'gui' object 'noGUI' not found",
    fixed = TRUE
  )
})
SciViews/svGUI documentation built on May 14, 2022, 5:50 p.m.