Module: Range::Etest

Defined in:
lib/vex/base/range_ext.rb

Instance Method Summary collapse

Instance Method Details

#test_numericObject



25
26
27
# File 'lib/vex/base/range_ext.rb', line 25

def test_numeric
  assert_equal 1, -1.limit(1..3)
end

#test_rangeObject



17
18
19
20
21
22
23
# File 'lib/vex/base/range_ext.rb', line 17

def test_range
  assert_equal 1, (1..3).limit(-1)
  assert_equal 1, (1..3).limit(1)
  assert_equal 2, (1..3).limit(2)
  assert_equal 3, (1..3).limit(3)
  assert_equal 3, (1..3).limit(4)
end