Sha256: 8a9bba6054a4eb56283d92631e71da83992136ef2d28368bf1337883f2885e47

Contents?: true

Size: 691 Bytes

Versions: 3

Compression:

Stored size: 691 Bytes

Contents

require 'spec_helper'

describe Datapipes::Composable do
  context 'with valid object' do
    let(:class_a) do
      Class.new do
        include Datapipes::Composable

        def call
          one
        end

        def one
          1
        end

        def exec
          accumulated.map(&:call)
        end
      end
    end

    let(:class_b) do
      Class.new do
        include Datapipes::Composable

        def call
          five
        end

        def five
          5
        end
      end
    end

    let(:a) { class_a.new }
    let(:b) { class_b.new }
    subject { a + b }

    it 'remember defined body' do
      expect(subject.exec).to eq [1, 5]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datapipes-0.0.3 spec/composable_spec.rb
datapipes-0.0.2 spec/composable_spec.rb
datapipes-0.0.1 spec/composable_spec.rb