Skip to content

Expectation::toRunFunction ​

Member of Expectation

idl
Expectation.toRunFunction, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, $
  /_expect_failure, $
  _ref_extra = value, $
  /debug, $
  output = value, $
  /time

Verifies that the expectation value is a function and can be called with the specified arguments/keywords.

Examples ​

idl
; run a function
(it.expects('my_func')).toRunFunction

; return a value from our function and verify result
(it.expects('my_func')).toRunFunction, output = value
(it.expects(value))._not_.toBeNull

Arguments ​

arg1 ​

optionalinputtype=any

First argument passed on to the function being called.

arg2 ​

optionalinputtype=any

Second argument passed on to the function being called.

arg3 ​

optionalinputtype=any

Third argument passed on to the function being called.

arg4 ​

optionalinputtype=any

Fourth argument passed on to the function being called.

arg5 ​

optionalinputtype=any

Fifth argument passed on to the function being called.

arg6 ​

optionalinputtype=any

Sixth argument passed on to the function being called.

arg7 ​

optionalinputtype=any

Seventh argument passed on to the function being called.

arg8 ​

optionalinputtype=any

Eighth argument passed on to the function being called.

Keywords ​

_expect_failure {#kw-_expect_failure} ​

optionalinputtype=Boolean

If 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=any

All other specified keywords will be passed to the function that is being called.

debug ​

optionalinputtype=Boolean

If set, errors in the procedure/function will be stopped on to make it easier to debug errors.

output ​

optionaloutputtype=any

Keyword that contains the result of running the function and can be useful to verify the return value.

time ​

optionalinputtype=Boolean

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

Licensed under MIT.