Expectation::toPrint
Member of Expectation
Expectation.toPrint, compare, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, $
/_expect_failure, $
_ref_extra = value, $
/debug, $
/fold_case, $
/is_functionVerifies that running a routine or object method prints some text to the console. If the expectation value is a string, it is the name of the procedure (or function, with is_function) to call. If the value is an object, the first argument after the text is the name of the method to call. All remaining arguments and keywords are passed on. The text may appear anywhere in the output, and a routine that raises an error fails the expectation.
Examples
(it.expects('my_pro')).toPrint, 'hello', input
(it.expects('my_pro'))._not_.toPrint, 'error', input
(it.expects('my_function')).toPrint, 'done', input, /is_function
(it.expects(obj)).toPrint, 'done', 'method', inputArguments
compare
requiredinputtype=StringSpecify the text that must be printed.
arg1
optionalinputtype=anyMethod name (objects) or first argument for the routine.
arg2
optionalin or outtype=anyOptional argument 2 for the routine or method.
arg3
optionalin or outtype=anyOptional argument 3 for the routine or method.
arg4
optionalin or outtype=anyOptional argument 4 for the routine or method.
arg5
optionalin or outtype=anyOptional argument 5 for the routine or method.
arg6
optionalin or outtype=anyOptional argument 6 for the routine or method.
arg7
optionalin or outtype=anyOptional argument 7 for the routine or method.
arg8
optionalin or outtype=anyOptional argument 8 for the routine or method.
arg9
optionalin or outtype=anyOptional argument 9 for the routine or method.
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 keywords are passed to the routine or method.
debug
optionalinputtype=BooleanIf set, errors are not caught to make debugging easier.
fold_case
optionalinputtype=BooleanIf set, ignore case when looking for the text.
is_function
optionalinputtype=BooleanSet if the routine or method is a function. By default, the routine or method is a procedure.