Expectation::toEqual
Member of Expectation
idl
Expectation.toEqual, compare, $
/_expect_failure, $
/fold_caseVerifies that an expectation value matches a compare value. It supports:
- scalars (i.e. strings, numbers)
- arrays (MUST have the exact same shape to be equal)
- hash
- orderedhash
- dictionary
- list
You can also compare lists to arrays and arrays to lists.
Examples
idl
(it.expects(hash('fortyTwo', 42))).toEqual, hash('fortyTwo', 42)
(it.expects(orderedhash('fortyTwo', 42))).toEqual, orderedhash('fortyTwo', 42)
(it.expects(dictionary('fortyTwo', 42))).toEqual, dictionary('fortyTwo', 42)
(it.expects(list('fortyTwo', 42))).toEqual, list('fortyTwo', 42)
(it.expects(['fortyTwo', '42'])).toEqual, ['fortyTwo', '42']
(it.expects(list('fortyTwo', '42'))).toEqual, ['fortyTwo', '42']
(it.expects(['fortyTwo', '42'])).toEqual, list('fortyTwo', '42')Arguments
compare
requiredinputtype=anySpecify a value to compare against. This can be a scalar, array, list, hash, orderedhash, or dictionary.
Keywords
_expect_failure {#kw-_expect_failure}
optionalinputtype=BooleanIf the test fails for some reason, set this to force passing because we expected failure. This keyword is for internal use only.
fold_case
optionalinputtype=BooleanSet this keyword to compare strings (scalars or arrays) without regard to case.