Sha256: 9ef094a2ece2d53850cd6370544abb4420bdb595efcbd1f8ca4528676e2bb937
Contents?: true
Size: 903 Bytes
Versions: 1
Compression:
Stored size: 903 Bytes
Contents
# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/facets/core/proc/to_method.rb # # Extracted Fri Feb 16 02:00:36 EST 2007 # Project.rb Test Extraction # require 'facets/core/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 # This is dependent on other tests! Be aware! def test_memory_leak a = 2 tproc = proc { |x| x + a } 100.times { tmethod = tproc.to_method assert_equal( 3, tmethod.call(1) ) } meths = Symbol.all_symbols.select { |s| s.to_s =~ /^_bind_/ } assert_equal( 1, meths.size ) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
facets-1.8.49 | test/lib/facets/core/proc/test_to_method.rb |