spec/unit/composer_spec.rb in transproc-0.2.4 vs spec/unit/composer_spec.rb in transproc-0.3.0

- old
+ new

@@ -1,20 +1,31 @@ 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 << t(:map_array, t(:symbolize_keys)) << - t(:map_array, t(:map_value, :age, t(:to_integer))) + 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