Sha256: 93dc3639aa475c0e14b9e878ae50ecd76d345086c36165205355f8da690517bd

Contents?: true

Size: 747 Bytes

Versions: 3

Compression:

Stored size: 747 Bytes

Contents

require_relative '../lib/linepipe'
require 'minitest/autorun'

class DevelopTest < MiniTest::Unit::TestCase
  def linepipe
    @linepipe ||= Linepipe.develop do
      data {
        %w(foo bar baz)
      }

      step("Upcasing") { |data|
        data.map(&:upcase)
      }

      step("Reversing") { |data|
        data.reverse
      }

      step("Sorting") { |data|
        data.sort
      }

      expect { |data|
        data == %w(BAR BAZ FOO)
      }
    end
  end

  def test_upcasing
    assert_equal %w(A B), linepipe['Upcasing'].apply(%w(a b))
  end

  def test_reversing
    assert_equal %w(b a), linepipe['Reversing'].apply(%w(a b))
  end

  def test_sorting
    assert_equal %w(a b c), linepipe['Sorting'].apply(%w(c a b))
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
linepipe-0.1.2 examples/develop.rb
linepipe-0.1.1 examples/develop.rb
linepipe-0.1.0 examples/develop.rb