Sha256: 4342cab3bf5c11bb32543fa17aa7b3b8653a1a217b27751fb1dd3877d74fa3f6
Contents?: true
Size: 353 Bytes
Versions: 9
Compression:
Stored size: 353 Bytes
Contents
require_relative '../spec_helper' describe 'Functions' do it 'should allow function composition and method chaining' do add_2 = ->(value) { value+2 } divide_by_2 = ->(value) { value/2 } expect(sequence(10).map(divide_by_2 * add_2)).to eq(sequence(6)) expect(sequence(10).map(divide_by_2.and_then(add_2))).to eq(sequence(7)) end end
Version data entries
9 entries across 9 versions & 1 rubygems