Sha256: 48461115c29dd8231119e0de4411822fb9b26ca4ef85eb0d210636e5e2c2f0a3

Contents?: true

Size: 805 Bytes

Versions: 4

Compression:

Stored size: 805 Bytes

Contents

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

describe LogStash::Outputs::NagiosNsca do

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

  describe "send" do

    let(:properties) { { "message" => "This is a message!", "nagios_status" => "nagios_status" } }
    let(:event)      { LogStash::Event.new(properties) }


    subject { LogStash::Outputs::NagiosNsca.new({ "nagios_status" => "1" }) }

    before(:each) do
      subject.register
      expect(subject).to receive(:command_file_exist?).and_return(true)
    end

    it "send the event to nagios" do
      expect(subject).to receive(:send_to_nagios)
      subject.receive(event)
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
logstash-output-nagios_nsca-2.0.2 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-2.0.1 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-2.0.0 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-1.1.0 spec/outputs/nagios_nsca_spec.rb