Sha256: 5a8c6591786801d5ea1e41c96ae49c464d6991fd4c0c679b4b00adb254fb600d

Contents?: true

Size: 638 Bytes

Versions: 5

Compression:

Stored size: 638 Bytes

Contents

covers 'facets/comparable/bound'

test_case Comparable do

  method :bound do

    test 'single argument' do
      3.bound(4).assert == 4
      4.bound(4).assert == 4
      5.bound(4).assert == 5
    end

    test 'two arguments' do
      4.bound(3,5).assert == 4
      3.bound(3,5).assert == 3
      5.bound(3,5).assert == 5
      2.bound(3,5).assert == 3
      6.bound(3,5).assert == 5
    end

    test 'on strings' do
      'd'.bound('c','e').assert == 'd'
      'c'.bound('c','e').assert == 'c'
      'e'.bound('c','e').assert == 'e'
      'b'.bound('c','e').assert == 'c'
      'f'.bound('c','e').assert == 'e'
    end

  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 test/core/comparable/test_bound.rb
facets-3.1.0 test/core/comparable/test_bound.rb
facets-3.0.0 test/core/comparable/test_bound.rb
facets-2.9.3 test/core/comparable/test_bound.rb
facets-2.9.2 test/core/comparable/test_bound.rb