Sha256: 7d3611fa9a1a4fda81379da14731c08e0602a9e5bc64a1efc39eee3eb50bcfd1
Contents?: true
Size: 690 Bytes
Versions: 10
Compression:
Stored size: 690 Bytes
Contents
require 'spec_helper' describe Transproc::Composer do before do module Foo extend Transproc::Registry import Transproc::ArrayTransformations import Transproc::HashTransformations import Transproc::Coercions end end subject(:object) do Class.new do include Transproc::Composer def fn compose do |fns| fns << Foo[:map_array, Foo[:symbolize_keys]] << Foo[:map_array, Foo[:map_value, :age, Foo[:to_integer]]] end end end.new end it 'allows composing functions' do expect(object.fn[[{ 'age' => '12' }]]).to eql([{ age: 12 }]) end after { Object.send :remove_const, :Foo } end
Version data entries
10 entries across 10 versions & 1 rubygems