Sha256: f4e353ea7432baee64944509e9b92140f61c5ac52265d8a95d8be38b164e3c3f

Contents?: true

Size: 464 Bytes

Versions: 4

Compression:

Stored size: 464 Bytes

Contents

covers 'facets/functor'

tests Functor do

  metaunit :new do
    fc = Functor.new do |op, *a, &b|
      [op, a, b]
    end
    (fc + 1).assert == [:+, [1], nil]
  end

  unit :__class__ do
    fc = Functor.new do |op, *a, &b|
      [op, a, b]
    end
    fc.__class__.assert == Functor
  end

  unit :to_proc do
    f = Functor.new do |op, *a|
      [op, *a]
    end
    p = f.to_proc
    p.assert.is_a? Proc
    p.call(:+,1,2,3).assert == [:+,1,2,3]
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

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