Sha256: 38332f69d0195787ff6cfb1d93dfa551877f763520ad383f7d14dcead06dee52

Contents?: true

Size: 760 Bytes

Versions: 19

Compression:

Stored size: 760 Bytes

Contents

# encoding: utf-8
require "spec_helper"

# use a dummy NOOP output to test Outputs::Base
class LogStash::Outputs::NOOP < LogStash::Outputs::Base
  config_name "noop"
  milestone 2

  config :dummy_option, :validate => :string

  def register; end

  def receive(event)
    return output?(event)
  end
end

describe "LogStash::Outputs::Base#worker_setup" do
  it "should create workers using original parameters except workers = 1" do
    params = { "dummy_option" => "potatoes", "codec" => "json", "workers" => 2 }
    worker_params = params.dup; worker_params["workers"] = 1
    output = LogStash::Outputs::NOOP.new(params.dup)
    expect(LogStash::Outputs::NOOP).to receive(:new).twice.with(worker_params).and_call_original
    output.worker_setup
  end
end

Version data entries

19 entries across 18 versions & 2 rubygems

Version Path
logstash-core-2.1.3-java spec/outputs/base_spec.rb
logstash-core-2.1.2-java spec/outputs/base_spec.rb
logstash-core-2.1.2.snapshot1-java spec/outputs/base_spec.rb
logstash-core-2.1.1-java spec/outputs/base_spec.rb
logstash-core-2.1.0-java spec/outputs/base_spec.rb
logstash-core-2.1.0.snapshot4-java spec/outputs/base_spec.rb
logstash-core-2.1.0.snapshot3-java spec/outputs/base_spec.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-core-2.0.1-java/spec/outputs/base_spec.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-core-2.0.0-java/spec/outputs/base_spec.rb
logstash-core-2.0.1-java spec/outputs/base_spec.rb
logstash-core-2.1.0.snapshot2-java spec/outputs/base_spec.rb
logstash-core-2.1.0.snapshot1-java spec/outputs/base_spec.rb
logstash-core-2.0.1.snapshot1-java spec/outputs/base_spec.rb
logstash-core-2.0.0-java spec/outputs/base_spec.rb
logstash-core-2.0.0.rc1-java spec/outputs/base_spec.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/logstash-core-2.0.0.beta3-java/spec/outputs/base_spec.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/logstash-core-2.0.0.beta3-java/spec/outputs/base_spec.rb
logstash-core-2.0.0.beta3-java spec/outputs/base_spec.rb
logstash-core-2.0.0.beta2-java spec/outputs/base_spec.rb