Expectation::toHaveKey
Member of Expectation
idl
Expectation.toHaveKey, key, $
/_expect_failureVerifies that the expectation value (a hash, orderedhash, or dictionary) has a key.
Examples
idl
(it.expects(hash('name', 'luna'))).toHaveKey, 'name'
(it.expects(dictionary('name', 'luna')))._not_.toHaveKey, 'age'Arguments
key
requiredinputtype=String | NumberSpecify the key to look for.
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.