Sha256: 3356727d264b2c0970e72e5b285ce55c59d4ebebbcddbb48a440cd393cb0389e

Contents?: true

Size: 560 Bytes

Versions: 1

Compression:

Stored size: 560 Bytes

Contents

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

require 'facet/proc/to_method.rb'


  require 'test/unit'

  class TCProc < Test::Unit::TestCase

    def test_to_method
      a = 2
      tproc = proc { |x| x + a }  
      tmethod = tproc.to_method(:tryit)
      assert_equal( 3, tmethod.call(1) )
      assert_respond_to( self, :tryit )
      assert_equal( 3, tryit(1) )
    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_to_method.rb