Sha256: 2a7880e62322a9c04d30826e202b05c9a35aa4eb91754f55f97923748857bd42

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

require 'test_helper'

class TestStep < MiniTest::Test
  def setup
    @test_string = "row 1\nrow 2"
    @incoming = StringIO.new(@test_string)
    @outgoing = TestIO.new
    @step = Rodimus::Step.new
    @step.incoming = @incoming
    @step.outgoing = @outgoing
  end

  def test_streaming_rows
    @step.run
    assert_equal @test_string, @outgoing.history.join
  end

  def test_process_row
    @step.define_singleton_method(:process_row) do |row|
      row.upcase
    end
    @step.run
    assert_equal @test_string.upcase, @outgoing.history.join
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rodimus-1.3.1 test/rodimus/step_test.rb
rodimus-1.3.0 test/rodimus/step_test.rb