Method: RSpec::Matchers#be_between

Defined in:
lib/rspec/matchers.rb

#be_between(min, max) ⇒ Object Also known as: a_value_between

Passes if actual.between?(min, max). Works with any Comparable object, including String, Symbol, Time, or Numeric (Fixnum, Bignum, Integer, Float, Complex, and Rational).

By default, be_between is inclusive (i.e. passes when given either the max or min value), but you can make it exclusive by chaining that off the matcher.

Examples:

expect(5).to      be_between(1, 10)
expect(11).not_to be_between(1, 10)
expect(10).not_to be_between(1, 10).exclusive


395
396
397
# File 'lib/rspec/matchers.rb', line 395

def be_between(min, max)
  BuiltIn::BeBetween.new(min, max)
end