Sha256: 89be117d3567414889c847675d9cd045201ff6df6d5424a946b184922a7090c4

Contents?: true

Size: 844 Bytes

Versions: 10

Compression:

Stored size: 844 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).with(subject.cmd, instance_of(String))
      subject.receive(event)
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
logstash-output-nagios_nsca-3.0.7 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-3.0.6 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-3.0.5 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-3.0.4 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-3.0.3 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-3.0.2 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-3.0.1 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-3.0.0 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-2.0.5 spec/outputs/nagios_nsca_spec.rb
logstash-output-nagios_nsca-2.0.3 spec/outputs/nagios_nsca_spec.rb