Sha256: 13953b59e4ff7c4eeaf9a54fe110de91fc5276bcc9da2b1c822f60590e17e381

Contents?: true

Size: 698 Bytes

Versions: 5

Compression:

Stored size: 698 Bytes

Contents

# encoding: utf-8
require_relative "../spec_helper"

describe LogStash::Outputs::Stdout do

  it "should register without errors" do
    plugin = LogStash::Plugin.lookup("output", "stdout").new({})
    expect { plugin.register }.to_not raise_error
  end

  describe "#send" do

    subject { LogStash::Outputs::Stdout.new({}) }

    let(:properties) { { "message" => "This is a message!"} }
    let(:event) { double("event") }
    let(:encoded) { double("encoded") }

    before(:each) do
      subject.register
    end

    it "sends the generated event out" do
      expect($stdout).to receive(:write).with(encoded)
      subject.multi_receive_encoded([[event, encoded]])
    end
    
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
logstash-output-stdout-3.1.4 spec/outputs/stdout_spec.rb
logstash-output-stdout-3.1.3 spec/outputs/stdout_spec.rb
logstash-output-stdout-3.1.2 spec/outputs/stdout_spec.rb
logstash-output-stdout-3.1.1 spec/outputs/stdout_spec.rb
logstash-output-stdout-3.1.0 spec/outputs/stdout_spec.rb