Sha256: c9c268ff309fb02421aca9f1a8c50e94a432629c9f27b2d0affcd188b1a6873b

Contents?: true

Size: 914 Bytes

Versions: 9

Compression:

Stored size: 914 Bytes

Contents

# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
require "logstash/event"
require "logstash/codecs/s3_plain"

describe LogStash::Codecs::S3Plain do
  subject { LogStash::Codecs::S3Plain.new }

  describe "#encode" do
    it 'should accept a nil list for the tags' do
      subject.on_event do |data|
        data.should match(/\nTags:\s\n/)
      end

      subject.encode(LogStash::Event.new)
    end

    it 'should accept a list of tags' do
      event = LogStash::Event.new({"tags" => ["elasticsearch", "logstash", "kibana"] })

      subject.on_event do |data|
        data.should match(/\nTags:\selasticsearch,\slogstash,\skibana\n/)
      end

      subject.encode(event)
    end

    it "return to_s if its not LogStash::Event" do
      event = {"test" => "A-B-C" }

      subject.on_event do |data|
        data.should == event.to_s
      end

      subject.encode(event)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logstash-codec-s3plain-2.0.6 spec/codecs/s3_plain_spec.rb
logstash-codec-s3plain-2.0.5 spec/codecs/s3_plain_spec.rb
logstash-codec-s3plain-2.0.4 spec/codecs/s3_plain_spec.rb
logstash-codec-s3plain-2.0.2 spec/codecs/s3_plain_spec.rb
logstash-codec-s3plain-2.0.1 spec/codecs/s3_plain_spec.rb
logstash-codec-s3plain-0.1.6 spec/codecs/s3_plain_spec.rb
logstash-codec-s3plain-0.1.5 spec/codecs/s3_plain_spec.rb
logstash-codec-s3plain-0.1.4 spec/codecs/s3_plain_spec.rb
logstash-codec-s3plain-0.1.3 spec/codecs/s3_plain_spec.rb