Expectation::toRunFunctionMethod
Member of Expectation
Expectation.toRunFunctionMethod, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, $
/_expect_failure, $
_ref_extra = value, $
/debug, $
output = value, $
/timeVerifies that the expectation value is an object and can run the specified function method with the provided arguments/keywords.
Note that, if you need to test a static method, you can use one of the two following approaches:
(it.expects('execute')).toRunFunction, 'someObj.staticMethod()'
(it.expects(1)).toEqual, execute('someObj.staticMethod()')Examples
; create an object
e = it.expects(plot(/test, /buffer))
; run a function method and keep the result
e.toRunFunctionMethod, 'copyWindow', output = value
; verify result
(it.expects(value))._not_.toBeNullArguments
method
requiredinputtype=StringSpecify the method that you want to run.
arg1
optionalinputtype=anyFirst argument passed on to the method being called.
arg2
optionalinputtype=anySecond argument passed on to the method being called.
arg3
optionalinputtype=anyThird argument passed on to the method being called.
arg4
optionalinputtype=anyFourth argument passed on to the method being called.
arg5
optionalinputtype=anyFifth argument passed on to the method being called.
arg6
optionalinputtype=anySixth argument passed on to the method being called.
arg7
optionalinputtype=anySeventh argument passed on to the method being called.
arg8
optionalinputtype=anyEighth argument passed on to the method being called.
Keywords
_expect_failure {#kw-_expect_failure}
optionalinputtype=BooleanIf the test fails for some reason, set this to force passing because we expected failure. This is an internal keyword and should not be used.
_ref_extra {#kw-_ref_extra}
optionalinputtype=anyAll other specified keywords will be passed to the method that is being called.
debug
optionalinputtype=BooleanIf set, errors in the procedure/function will be stopped on to make it easier to debug errors.
output
optionaloutputtype=anyKeyword that contains the result of running the function and can be useful to verify the return value.
time
optionalinputtype=BooleanIf set, the time to run the function will be added to the test summary. Note that this is different from profiling the tests and only times this specific function call.