context("test-compute_squares")
test_that("square works", {
expect_equal(compute_square(2), 4)
expect_equal(compute_square(-6), 36)
})
test_that("needs number", {
expect_error(compute_square("character"))
expect_error(compute_square(NULL))
expect_is(compute_square(2), "numeric")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.