Skip to content

Expectation::toBeBetween ​

Member of Expectation

idl
Expectation.toBeBetween, low, high, $
  /_expect_failure, $
  /exclusive

Verifies that the expectation value is between a low and high number. The range is inclusive unless EXCLUSIVE is set. If the value is an array, every element must be in range.

Examples ​

idl
(it.expects(50)).toBeBetween, 0, 100
(it.expects(100))._not_.toBeBetween, 0, 100, /exclusive

Arguments ​

low ​

requiredinputtype=Number

Specify the lower bound as a numeric scalar.

high ​

requiredinputtype=Number

Specify the upper bound as a numeric scalar. Must be greater than or equal to low.

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.

exclusive ​

optionalinputtype=Boolean

If set, values equal to low or high are not in range.

Licensed under MIT.