Sha256: 038a5e1128ce818b93ef5ad1ec13bfc97499985646f50c58f7ecde7969d5a83e

Contents?: true

Size: 899 Bytes

Versions: 3

Compression:

Stored size: 899 Bytes

Contents

require File.expand_path(
    File.join(File.dirname(__FILE__), %w[.. .. lib germinate]))

module Germinate
  describe Pipeline, "given a set of processes" do
    before :each do 
      @intput   = stub("Input")
      @output1  = stub("Output 1")
      @output2  = stub("Output 2")
      @output3  = stub("Output 3")
      @process1 = stub("Process 1", :call => @output1)
      @process2 = stub("Process 2", :call => @output2)
      @process3 = stub("Process 3", :call => @output3)
      @it = Germinate::Pipeline.new([@process1, @process2, @process3])
    end

    it "should compose the processes into a pipeline" do
      @process1.should_receive(:call).with(@input).and_return(@output1)
      @process2.should_receive(:call).with(@output1).and_return(@output2)
      @process3.should_receive(:call).with(@output2).and_return(@output3)
      @it.call(@input).should == @output3
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devver-germinate-1.0.0 spec/germinate/pipeline_spec.rb
devver-germinate-1.0.1 spec/germinate/pipeline_spec.rb
devver-germinate-1.1.0 spec/germinate/pipeline_spec.rb