Sha256: 25e0fc4dcc27e1df64c3db929bdfd0f5668f255c8791c69c629f9dc60cbecc67

Contents?: true

Size: 504 Bytes

Versions: 15

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

module Shipit
  class LineBufferTest < ActiveSupport::TestCase
    setup { @buffer = LineBuffer.new }

    test "buffers partial lines" do
      refute_predicate(@buffer.buffer("a"), :any?)
      assert_equal(["a"], @buffer.buffer("\n").to_a)
      assert_predicate(@buffer, :empty?)
    end

    test "splits up multiple lines" do
      assert_equal(%w(a b), @buffer.buffer("a\nb\n").to_a)
      assert_predicate(@buffer, :empty?)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 test/unit/line_buffer_test.rb
shipit-engine-0.38.0 test/unit/line_buffer_test.rb
shipit-engine-0.37.0 test/unit/line_buffer_test.rb
shipit-engine-0.36.1 test/unit/line_buffer_test.rb
shipit-engine-0.36.0 test/unit/line_buffer_test.rb
shipit-engine-0.35.1 test/unit/line_buffer_test.rb
shipit-engine-0.35.0 test/unit/line_buffer_test.rb
shipit-engine-0.34.0 test/unit/line_buffer_test.rb
shipit-engine-0.33.0 test/unit/line_buffer_test.rb
shipit-engine-0.32.0 test/unit/line_buffer_test.rb
shipit-engine-0.31.0 test/unit/line_buffer_test.rb
shipit-engine-0.30.0 test/unit/line_buffer_test.rb
shipit-engine-0.29.0 test/unit/line_buffer_test.rb
shipit-engine-0.28.1 test/unit/line_buffer_test.rb
shipit-engine-0.28.0 test/unit/line_buffer_test.rb