Skip to content

Expectation::toBeEmpty ​

Member of Expectation

idl
Expectation.toBeEmpty, $
  /_expect_failure

Verifies that the expectation value is empty. A string is empty when it has no characters (every element, for an array) and a list, hash, orderedhash or dictionary is empty when it has no items. Other values always have at least one element.

Examples ​

idl
(it.expects('')).toBeEmpty
(it.expects(list())).toBeEmpty
(it.expects(hash('a', 1)))._not_.toBeEmpty

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.