Skip to content

Expectation::toBeInstanceOf ​

Member of Expectation

idl
Expectation.toBeInstanceOf, type, $
  /_expect_failure

Verifies that the expectation value is an object that is an instance of a class, including through inheritance (uses idl obj_isa()). Values that are not objects fail the expectation. For an array of objects, every element must be an instance of the class.

Examples ​

idl
(it.expects(list())).toBeInstanceOf, 'List'
(it.expects(orderedhash())).toBeInstanceOf, 'Hash'
(it.expects(42))._not_.toBeInstanceOf, 'List'

Arguments ​

type ​

requiredinputtype=String

Specify the class name to check, case insensitive.

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.