Sha256: c25fe508f555c4841b7197562bfe175f5cf75cdbfdcd10430dddd663816cf9de

Contents?: true

Size: 1.25 KB

Versions: 8

Compression:

Stored size: 1.25 KB

Contents

require "logstash/devutils/rspec/spec_helper"
require "logstash/inputs/stomp"

describe LogStash::Inputs::Stomp do
  let(:klass) { LogStash::Inputs::Stomp }
  let(:host) { "localhost" }
  let(:destination) { "/foo" }
  let(:stomp_settings) {
    {
      "host" => host,
      "destination" => destination
    }
  }
  let(:instance) { klass.new(stomp_settings) }

  context "when connected" do
    let(:client) { double("client") }

    before do
      allow(instance).to receive(:new_client).and_return(client)
      allow(client).to receive(:connect)
      allow(client).to receive(:connected?).and_return(true)
      allow(client).to receive(:on_connection_closed)
    end

    it "should register without error" do
      instance.register
    end
  end

  describe "stopping" do
    let(:config) { {"host" => "localhost", "destination" => "/foo"} }
    let(:client) { double("client") }
    before do
      allow(subject).to receive(:new_client).and_return(client)
      allow(subject).to receive(:connect)
      allow(client).to receive(:connect)
      allow(client).to receive(:connected?).and_return(true)
      allow(client).to receive(:on_connection_closed)
      allow(client).to receive(:subscribe)
    end
    it_behaves_like "an interruptible input plugin"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
logstash-input-stomp-3.0.5 spec/inputs/stomp_spec.rb
logstash-input-stomp-3.0.4 spec/inputs/stomp_spec.rb
logstash-input-stomp-3.0.3 spec/inputs/stomp_spec.rb
logstash-input-stomp-3.0.2 spec/inputs/stomp_spec.rb
logstash-input-stomp-3.0.1 spec/inputs/stomp_spec.rb
logstash-input-stomp-3.0.0 spec/inputs/stomp_spec.rb
logstash-input-stomp-2.0.5 spec/inputs/stomp_spec.rb
logstash-input-stomp-2.0.3 spec/inputs/stomp_spec.rb