tests/testthat/helper-foo-tbl.R

new_foo_tbl <- function(..., class = NULL) {
  stopifnot(is.null(class))
  new_tbl(..., class = "foo_tbl")
}

local_foo_tbl <- function(frame = caller_env()) {
  local_methods(
    .frame = frame,
    tbl_sum.foo_tbl = function(x) {
      c(NextMethod(), foo = "bar")
    }
  )
}

Try the pillar package in your browser

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

pillar documentation built on March 31, 2023, 10:19 p.m.