tests/testthat/test-rdname.R

# Based on
# https://github.com/mikldk/roxytest/issues/24
test_that("rdname", {
  out <- capture_messages(roxygen2::roc_proc_text(return_roclet(), "
    #' Who Am I?
    #'
    #' @return A tibble with user information 
    #'
    #' @export
    #' @rdname whoami
    #' @examples
    #' users_list(user = 'me')
    #' whoami()
    users_list <- function(user){
      NULL
    }
    
    #' @export
    #' @rdname whoami
    whoami <- function(){
       users_list(user = 'me')
    }"))
  #out
  
  expect_equal(0L, length(out))
})

Try the roxytest package in your browser

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

roxytest documentation built on Jan. 11, 2023, 5:14 p.m.