expect_snapshot_r_process {asciicast} | R Documentation |
testthat snapshot test with asciicast
Description
This function is very similar to testthat::expect_snapshot_output()
,
but it runs the code in an asciciast subprocess, using record_output()
.
Usage
expect_snapshot_r_process(
...,
interactive = TRUE,
echo = TRUE,
startup = NULL,
transform = NULL,
variant = NULL
)
Arguments
... |
Code to run (unnamed arguments) and arguments to pass to
|
interactive |
Whether to use an interactive R process to evaluate the code. |
echo |
Whether to echo the code in the subprocess before running it. |
startup |
Expression to evaluate in the subprocess before recording the snapshot. By default it loads and attaches the calling package, including its internal functions. |
transform |
Passed to |
variant |
Passed to |
Details
THe Code
part of the snapshot is always the same, but the
Output
part shows the code, assuming echo = TRUE
(the default).
Examples
Sys.getpid()
testthat::local_edition(3)
expect_snapshot_r_process(Sys.getpid())