Sha256: 1e83e5ef2e95c3752b350ad02e80118a824cdcdf7dc36ae59ff36fefba0609ba

Contents?: true

Size: 603 Bytes

Versions: 4

Compression:

Stored size: 603 Bytes

Contents

covers 'facets/proc/bind'

testcase Proc do

  # Not sure why this is thread critical?
  unit :bind => "thread critial" do
    a = 2
    tproc = lambda { |x| x + a }
    99.times {
      tmethod = tproc.bind(self) #to_method
      tmethod.call(1).assert == 3
    }

    meths = (
      Object.instance_methods +
      Object.public_instance_methods +
      Object.private_instance_methods +
      Object.protected_instance_methods
    )
    meths = meths.select{ |s| s.to_s =~ /^_bind_/ }
    #meths = Symbol.all_symbols.select { |s| s.to_s =~ /^_bind_/ }  # why?

    meths.size.assert == 0
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-2.9.1 test/core/proc/test_bind.rb
facets-2.9.0 test/core/proc/test_bind.rb
facets-2.9.0.pre.2 test/core/proc/test_bind.rb
facets-2.9.0.pre.1 test/core/proc/test_bind.rb