Description Usage Arguments Value Examples
This assertion checks that a given function is called with specified arguments during the execution of another expression.
1 | expect_receives(function_name, arguments, expr, times = 1)
|
function_name |
name. Either the name of the function, or
a package function given by the |
arguments |
list. A subset of the arguments we expect the function to be called with. |
expr |
expression. An R expression that should somewhere during
it execution call |
times |
integer. The number of times the function should be
called with these arguments. By default, |
NULL
, invisibly, but an error if the expectation
is not satisfied (i.e., function_name
is not called).
1 | # expect_receives(force, list(1), lapply(c(1,1), force), times = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.