Skip to content

Commit

Permalink
#1839 dummy function created
Browse files Browse the repository at this point in the history
  • Loading branch information
rossfarrugia committed Mar 29, 2023
1 parent c259b94 commit c2fb85f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
27 changes: 27 additions & 0 deletions R/my_first_fcn.R
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!")
}
}
13 changes: 13 additions & 0 deletions tests/testthat/test-my_first_fcn.R
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"
)
})

0 comments on commit c2fb85f

Please sign in to comment.