Sha256: bf9dfa4780fb33aee0ffdf5988511a04a6773744c581c1458c8905c51a2f7014

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/string/to_proc.rb
#
# Extracted Tue Apr 18 08:56:38 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/core/string/to_proc.rb'


  require 'test/unit'

  class TCString < Test::Unit::TestCase

    def test_to_proc
      assert_nothing_raised { @add = '|x,y| x + y'.to_proc }
      assert_equal(4, @add.call(2,2))    
      @t = 3
      @multi = '|y| @t * y'.to_proc(self)
      assert_equal(6, @multi.call(2))
      x = 4
      @div = '|y| x / y'.to_proc(binding)
      assert_equal(2, @div.call(2))
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.3.1 test/lib/facets/core/string/test_to_proc.rb