library(rutilities)
context("Test that is_true_or_false throws error correctly")
test_that("Test that non-TRUE or FALSE arguments throw error",{
expect_error(is_true_or_false(rep(TRUE, 2)),
"Argument must be TRUE or FALSE")
expect_error(is_true_or_false(NA),
"Argument must be TRUE or FALSE")
expect_error(is_true_or_false("TRUE"),
"Argument must be TRUE or FALSE")
expect_error(is_true_or_false(1),
"Argument must be TRUE or FALSE")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.