expect_receives: Expect a given function to be receive specified arguments...

Description Usage Arguments Value Examples

Description

This assertion checks that a given function is called with specified arguments during the execution of another expression.

Usage

1
expect_receives(function_name, arguments, expr, times = 1)

Arguments

function_name

name. Either the name of the function, or a package function given by the :: or ::: operators.

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 function_name.

times

integer. The number of times the function should be called with these arguments. By default, 1.

Value

NULL, invisibly, but an error if the expectation is not satisfied (i.e., function_name is not called).

Examples

1
# expect_receives(force, list(1), lapply(c(1,1), force), times = 2)

robertzk/rum documentation built on May 27, 2019, 11:37 a.m.