Sha256: e2fa7b72a762afffaa81766c9b6130cec1e1bdb8e1d2942878356e1dab975634

Contents?: true

Size: 582 Bytes

Versions: 4

Compression:

Stored size: 582 Bytes

Contents

require 'test/unit'
require 'facet/comparable/bound_by'


class TC_Comparable < Test::Unit::TestCase
  
  # bound_by

  def test_bound_by
    assert_equal( 4, 4.bound_by(3,5) )
    assert_equal( 3, 3.bound_by(3,5) )
    assert_equal( 5, 5.bound_by(3,5) )
    assert_equal( 3, 2.bound_by(3,5) )
    assert_equal( 5, 6.bound_by(3,5) )
    assert_equal( 'd', 'd'.bound_by('c','e') )
    assert_equal( 'c', 'c'.bound_by('c','e') )
    assert_equal( 'e', 'e'.bound_by('c','e') )
    assert_equal( 'c', 'b'.bound_by('c','e') )
    assert_equal( 'e', 'f'.bound_by('c','e') )
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-0.6.3 test/comparable/tc_comparable.rb
facets-0.7.0 test/comparable/tc_comparable.rb
facets-0.7.1 test/comparable/tc_comparable.rb
facets-0.7.2 test/comparable/tc_comparable.rb