Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closes # 1839 dummy function created #2209

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions R/my_first_fcn.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#' Derive Extension Example
#'
#' Says hello admiral
#'
#' @param hw TRUE or FALSE
#'
#' @author author sc460144
#'
#' @details welcome to admiral family message
#'
#' @return Happy Message
#'
#' @family
#'
#' @keywords
#'
#' @export
#'
#' @examples
#' hello_admiral(hw = FALSE)
hello_admiral <- function(hw = TRUE) {
if (hw) {
message("Welcome to the admiral family!")
} else {
message("Welcome to the admiral family!")
}
}

14 changes: 14 additions & 0 deletions tests/testthat/test-my_first_fcn.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test_that("hello admiral greets without hw", {
expect_message(
hello_admiral(),
"^Welcome to the admiral family!\\n"
)
})

test_that("hello admiral greets with hw", {
expect_message(
hello_admiral(TRUE),
"^Welcome to the admiral family!\\n"
)
})

Loading