Sha256: 34903321a0a5d5f28e1de637411de96b42c8a8de1c1275855de3b231d15f53e7
Contents?: true
Size: 698 Bytes
Versions: 2
Compression:
Stored size: 698 Bytes
Contents
# frozen_string_literal: true 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
transproc-1.1.1 | spec/unit/composer_spec.rb |
transproc-1.1.0 | spec/unit/composer_spec.rb |