Sha256: 7cad66f90d40ef3f56bd4be3c51211c9e3fc8173980b1a679ffc363d695c47c3
Contents?: true
Size: 706 Bytes
Versions: 21
Compression:
Stored size: 706 Bytes
Contents
require 'spec_helper' RSpec.describe Yaks::FP do include described_class describe '#curry_method' do def method_3args(a,b,c) "#{a}-#{b}-#{c}" end it 'should curry the method' do expect(curry_method(:method_3args).(1).(2,3)).to eql "1-2-3" end end describe '#send_with_args' do it 'should bind the arguments' do expect(send_with_args(:+, 'foo').('bar')).to eql 'barfoo' end it 'should bind the block' do expect(send_with_args(:map) {|x| x.upcase }.(['bar'])).to eql ['BAR'] end end describe '#identity_function' do it 'should return whatever you pass it' do expect(identity_function.(:foo)).to equal :foo end end end
Version data entries
21 entries across 21 versions & 2 rubygems