Skip to content

Expectation::toHaveKey ​

Member of Expectation

idl
Expectation.toHaveKey, key, $
  /_expect_failure

Verifies 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 | Number

Specify the key 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.