exercism/r/hello-world/test_hello-world.R

17 lines
345 B
R
Raw Normal View History

2017-08-15 15:04:10 +00:00
source("./hello-world.R")
library(testthat)
test_that("no name", {
expect_equal(hello_world(), "Hello, World!")
})
test_that("sample name", {
expect_equal(hello_world("Alice"), "Hello, Alice!")
})
test_that("other sample name", {
expect_equal(hello_world("Bob"), "Hello, Bob!")
})
message("All tests passed for exercise: hello-world")