View source: R/mock2-helpers.R
mock_output_sequence | R Documentation |
Specify multiple return values for mocking
mock_output_sequence(..., recycle = FALSE)
... |
< |
recycle |
whether to recycle. If |
A function that you can use within local_mocked_bindings()
and
with_mocked_bindings()
Other mocking:
local_mocked_bindings()
# inside local_mocked_bindings()
## Not run:
local_mocked_bindings(readline = mock_output_sequence("3", "This is a note", "n"))
## End(Not run)
# for understanding
mocked_sequence <- mock_output_sequence("3", "This is a note", "n")
mocked_sequence()
mocked_sequence()
mocked_sequence()
try(mocked_sequence())
recycled_mocked_sequence <- mock_output_sequence(
"3", "This is a note", "n",
recycle = TRUE
)
recycled_mocked_sequence()
recycled_mocked_sequence()
recycled_mocked_sequence()
recycled_mocked_sequence()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.