mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
3763ecba67
commit
e5ba35e0c7
1 changed files with 12 additions and 0 deletions
|
@ -6,6 +6,8 @@ class LogStash::Outputs::NOOP < LogStash::Outputs::Base
|
|||
config_name "noop"
|
||||
milestone 2
|
||||
|
||||
config :dummy_option, :validate => :string
|
||||
|
||||
def register; end
|
||||
|
||||
def receive(event)
|
||||
|
@ -13,6 +15,16 @@ class LogStash::Outputs::NOOP < LogStash::Outputs::Base
|
|||
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
|
||||
|
||||
describe "LogStash::Outputs::Base#output?" do
|
||||
it "should filter by type" do
|
||||
output = LogStash::Outputs::NOOP.new("type" => "noop")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue