# within test-my_t_test.R
test_that("t-test works", {
expect_is(my_t_test(rnorm(10, 0, 1), alternative = "less", mu = 0), "list")
expect_is(my_t_test(rnorm(10, 0, 1), alternative = "two.sided", mu = 0), "list")
expect_is(my_t_test(rnorm(10, 0, 1), alternative = "greater", mu = 0), "list")
expect_is(my_t_test(rnorm(10, 0, 1), alternative = "less", mu = 0)$p_value,
"numeric")
})
test_that("incorrect input throws error", {
expect_error(my_t_test(my_gapminder, alternative = "line", mu = 0))
expect_error(my_t_test(rnorm(10, 0, 1), alternative = 5, mu = "string"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.