Skip to content

Expectation::toBeSameObject ​

Member of Expectation

idl
Expectation.toBeSameObject, compare, $
  /_expect_failure

Verifies that the expectation value is the exact same object reference as the compare value. This differs from idl toEqual which compares the contents of objects such as lists and hashes.

Examples ​

idl
a = list(1, 2)
b = list(1, 2)
(it.expects(a)).toBeSameObject, a
(it.expects(a))._not_.toBeSameObject, b

Arguments ​

compare ​

requiredinputtype=Object<any>

Specify the object reference to compare against.

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.