Sha256: 24168501d5eadfa40b2160e1f4c96b53fbbf3531d2be735e57f96bd221766b40

Contents?: true

Size: 931 Bytes

Versions: 5

Compression:

Stored size: 931 Bytes

Contents

# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
require "socket"
require "logstash/inputs/stdin"

describe LogStash::Inputs::Stdin do
  context ".reloadable?" do
    subject { described_class }

    it "returns true" do
      expect(subject.reloadable?).to be_falsey
    end
  end

  context "codec (PR #1372)" do
    it "switches from plain to line" do
      require "logstash/codecs/plain"
      require "logstash/codecs/line"
      plugin = LogStash::Inputs::Stdin.new("codec" => LogStash::Codecs::Plain.new)
      plugin.register
      insist { plugin.codec }.is_a?(LogStash::Codecs::Line)
    end

    it "switches from json to json_lines" do
      require "logstash/codecs/json"
      require "logstash/codecs/json_lines"
      plugin = LogStash::Inputs::Stdin.new("codec" => LogStash::Codecs::JSON.new)
      plugin.register
      insist { plugin.codec }.is_a?(LogStash::Codecs::JSONLines)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
logstash-input-stdin-3.2.6 spec/inputs/stdin_spec.rb
logstash-input-stdin-3.2.5 spec/inputs/stdin_spec.rb
logstash-input-stdin-3.2.4 spec/inputs/stdin_spec.rb
logstash-input-stdin-3.2.3 spec/inputs/stdin_spec.rb
logstash-input-stdin-3.2.2 spec/inputs/stdin_spec.rb