
Process blocks for 'longtests' roclet
Source:R/longtests_rcolet.R
roclet_process.roclet_longtests.Rd
This function processes a list of blocks for the 'longtests' roclet. It calls the 'internal_longtests_roclet_process' function with the specified blocks and additional arguments. The code in the tests is indented, a 'test_that' boilerplate is added to the tests, and a 'context' line is not added to the header.
Examples
# Create a dummy block function
block <- function(roclet, value) {
list(roclet = roclet, value = value)
}
# Create a new roclet_longtests object
x <- longtests_roclet()
# Define some roxygen2 blocks
blocks <- list(
block(
roclet = "longtests",
value = list(
raw = "test_that('this is a test', { expect_equal(1, 1) })"
)
)
)
blocks <- structure(blocks, class = "roclet_longtests")
# Define the environment and base path
env <- globalenv()
base_path <- tempdir()
# Process the blocks
roxygen2::roclet_process(x, blocks, env, base_path)
#> $longtests
#> list()
#>