Sha256: 70b55e0291e42a6826b17b50c0bf26283cb6a570a6bcd5d18c0a5d56b0def987

Contents?: true

Size: 805 Bytes

Versions: 9

Compression:

Stored size: 805 Bytes

Contents

require "logstash/codecs/spool"
require "logstash/event"
require "insist"

describe LogStash::Codecs::Spool do
  subject do
    next LogStash::Codecs::Spool.new
  end

  context "#decode" do
    it "should return multiple spooled events" do
      e1 = LogStash::Event.new
      e2 = LogStash::Event.new
      e3 = LogStash::Event.new
      subject.decode([e1,e2,e3]) do |event|
        insist { event.is_a? LogStash::Event }
      end
    end
  end

  context "#encode" do
    it "should return a spooled event" do
      spool_size = Random.rand(10)
      subject.spool_size = spool_size
      got_event = false
      subject.on_event do |data|
        got_event = true
      end
      spool_size.times do
        subject.encode(LogStash::Event.new)
      end
      insist { got_event }
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
logstash-codec-spool-2.0.2 spec/codecs/spool_spec.rb
logstash-codec-spool-2.0.1 spec/codecs/spool_spec.rb
logstash-codec-spool-0.1.5 spec/codecs/spool_spec.rb
logstash-codec-spool-0.1.4 spec/codecs/spool_spec.rb
logstash-codec-spool-0.1.3 spec/codecs/spool_spec.rb
logstash-codec-spool-0.1.2 spec/codecs/spool_spec.rb
logstash-codec-spool-0.1.1 spec/codecs/spool_spec.rb
logstash-codec-spool-0.1.0 spec/codecs/spool_spec.rb
logstash-lib-1.3.2 spec/codecs/spool.rb