spec/pipeline/process_spec.rb in linepipe-0.1.2 vs spec/pipeline/process_spec.rb in linepipe-0.2.0

- old
+ new

@@ -8,12 +8,12 @@ let(:process) do Process.new(io).tap do |process| process.setup { process.taint } process.data { %w(foo bar baz) } - process.step('Upcasing') { |data| data.map(&:upcase) } - process.step('Reversing', &:reverse) + process.step('Upcasing') { |data| data.map(&:upcase) }.expect('is upcased') { |data| data.first == data.first.upcase } + process.step('Reversing', &:reverse).expect('is not reversed') { |data| data.first == 'foo' } # will fail process.expect { |data| data.first == 'BAZ' } end end describe '#[]' do @@ -50,9 +50,15 @@ it 'outputs information to the io stream' do process.develop expect(io.string).to match(/Stage 0 Upcasing/) expect(io.string).to match(/Stage 1 Reversing/) + end + + it 'outputs step expectation info to the io stream' do + process.develop + expect(io.string).to match(/is upcased: pass/) + expect(io.string).to match(/is not reversed: fail/) end describe 'when the expectations pass' do it 'outputs SUCCESS' do process.develop