Skip to content

Expectation::toContainEqual ​

Member of Expectation

idl
Expectation.toContainEqual, compare, $
  /_expect_failure

Verifies that the expectation value (an array, list, or the values of a hash, orderedhash, or dictionary) contains an item equal to the compare value. Unlike idl toContain, structures, lists, hashes and other nested values are compared by their contents. Scalar numbers and strings are compared with idl eq.

Examples ​

idl
(it.expects(list({a: 1}, {a: 2}))).toContainEqual, {a: 2}
(it.expects(list(list(1, 2), list(3)))).toContainEqual, list(3)

Arguments ​

compare ​

requiredinputtype=any

Specify the item to look for.

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 keyword is for internal use only.

Licensed under MIT.