Sha256: 078893c202a3de8f75b266786a49f04b6db7cf38b9578d80cc09960ab31c9d53

Contents?: true

Size: 687 Bytes

Versions: 1

Compression:

Stored size: 687 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facet/proc/compose.rb
#
# Extracted Wed Jan 25 11:25:39 EST 2006
# Unit Tools Reap Test Extractor
#

require 'facet/proc/compose.rb'


  require 'test/unit'

  class TCProc < Test::Unit::TestCase

    def test_compose
      a = lambda { |x| x + 4 }
      b = lambda { |y| y / 2 }
      assert_equal( 6, (a.compose(b)).call(4) )
      assert_equal( 4, (b.compose(a)).call(4) )
    end

    def test_compose_op
      a = lambda { |x| x + 4 }
      b = lambda { |y| y / 2 }
      assert_equal( 6, (a * b).call(4) )
      assert_equal( 4, (b * a).call(4) )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.0.3 packages/core/test/lib/facet/proc/test_compose.rb