-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c259b94
commit c2fb85f
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#' Derive Extension Example | ||
#' | ||
#' Says hello admiral | ||
#' | ||
#' @param hw TRUE or FALSE | ||
#' | ||
#' @author Open Source | ||
#' | ||
#' @details Something Something | ||
#' | ||
#' @return Happy Message | ||
#' | ||
#' @family der_adxx | ||
#' | ||
#' @keywords der_adxx | ||
#' | ||
#' @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!") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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" | ||
) | ||
}) |