tests/testthat/scripts/greet.R

#' Greet someone
#' @description
#' Test function for easy integration testing of how to a zephyr_option
#'
#' @param name Who to greet
#' @inheritParams testpkg-options-params
#' @examples
#' greet("Bob")
#' @export
greet <- function(
    name,
    greeting = zephyr::get_option("greeting", .envir = "testpkg")) {

  zephyr::msg_info(paste(greeting, name))
  return(invisible(name))
}

zephyr::create_option(
  name = "greeting",
  default = "hello"
)

Try the zephyr package in your browser

Any scripts or data that you put into this service are public.

zephyr documentation built on Aug. 22, 2025, 9:09 a.m.