Sha256: b07169032f8de92c1bbf408fb8fe3ca299b73e5ebd14fd2086cfbd4d37be063e

Contents?: true

Size: 421 Bytes

Versions: 5

Compression:

Stored size: 421 Bytes

Contents

covers 'facets/proc/compose'

test_case Proc do

  method :compose do

    test do
      a = lambda { |x| x + 4 }
      b = lambda { |y| y / 2 }
      (a.compose(b)).call(4).assert == 6
      (b.compose(a)).call(4).assert == 4
    end

  end

  method :* do

    test do
      a = lambda { |x| x + 4 }
      b = lambda { |y| y / 2 }
      (a * b).call(4).assert == 6
      (b * a).call(4).assert == 4
    end

  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 test/core/proc/test_compose.rb
facets-3.1.0 test/core/proc/test_compose.rb
facets-3.0.0 test/core/proc/test_compose.rb
facets-2.9.3 test/core/proc/test_compose.rb
facets-2.9.2 test/core/proc/test_compose.rb