Sha256: 85f9d4a3d968f33403c44b67c200d2cb0df05faf0b0c2c6f59a289bfdc40756a

Contents?: true

Size: 632 Bytes

Versions: 88

Compression:

Stored size: 632 Bytes

Contents

require 'em_test_helper'

class TestLineProtocol < Test::Unit::TestCase
  class LineProtocolTestClass
    include EM::Protocols::LineProtocol

    def lines
      @lines ||= []
    end

    def receive_line(line)
      lines << line
    end
  end

  def setup
    @proto = LineProtocolTestClass.new
  end

  def test_simple_split_line
    @proto.receive_data("this is")
    assert_equal([], @proto.lines)

    @proto.receive_data(" a test\n")
    assert_equal(["this is a test"], @proto.lines)
  end

  def test_simple_lines
    @proto.receive_data("aaa\nbbb\r\nccc\nddd")
    assert_equal(%w(aaa bbb ccc), @proto.lines)
  end

end

Version data entries

88 entries across 85 versions & 6 rubygems

Version Path
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/3.1.0/gems/eventmachine-1.2.7/tests/test_line_protocol.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/2.6.0/gems/eventmachine-1.2.7/tests/test_line_protocol.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/3.0.0/gems/eventmachine-1.2.7/tests/test_line_protocol.rb
sensu-em-2.7.0-java tests/test_line_protocol.rb
eventmachine-1.2.7-java tests/test_line_protocol.rb
eventmachine-1.2.7-x64-mingw32 tests/test_line_protocol.rb
eventmachine-1.2.7-x86-mingw32 tests/test_line_protocol.rb
eventmachine-1.2.7 tests/test_line_protocol.rb
eventmachine-1.2.6-x64-mingw32 tests/test_line_protocol.rb
eventmachine-1.2.6-x86-mingw32 tests/test_line_protocol.rb
eventmachine-1.2.6-java tests/test_line_protocol.rb
eventmachine-1.2.6 tests/test_line_protocol.rb
eventmachine-1.2.5-x86-mingw32 tests/test_line_protocol.rb
eventmachine-1.2.5-x64-mingw32 tests/test_line_protocol.rb
eventmachine-1.2.5-java tests/test_line_protocol.rb
eventmachine-1.2.5 tests/test_line_protocol.rb
eventmachine-1.2.3-x64-mingw32 tests/test_line_protocol.rb
eventmachine-1.2.3-x86-mingw32 tests/test_line_protocol.rb
eventmachine-1.2.3-java tests/test_line_protocol.rb
eventmachine-1.2.3 tests/test_line_protocol.rb