mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
6f9fb96818
commit
f2486324af
1 changed files with 35 additions and 0 deletions
|
@ -7,6 +7,41 @@ require "logstash/inputs/base"
|
||||||
require "logstash/filters/base"
|
require "logstash/filters/base"
|
||||||
|
|
||||||
describe LogStash::Plugin do
|
describe LogStash::Plugin do
|
||||||
|
context "reloadable" do
|
||||||
|
context "by default" do
|
||||||
|
subject do
|
||||||
|
Class.new(LogStash::Plugin) do
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "makes .reloadable? return true" do
|
||||||
|
expect(subject.reloadable?).to be_truthy
|
||||||
|
end
|
||||||
|
|
||||||
|
it "makes #reloadable? return true" do
|
||||||
|
expect(subject.new({}).reloadable?).to be_truthy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "user can overrides" do
|
||||||
|
subject do
|
||||||
|
Class.new(LogStash::Plugin) do
|
||||||
|
def self.reloadable?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "makes .reloadable? return true" do
|
||||||
|
expect(subject.reloadable?).to be_falsey
|
||||||
|
end
|
||||||
|
|
||||||
|
it "makes #reloadable? return true" do
|
||||||
|
expect(subject.new({}).reloadable?).to be_falsey
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "should fail lookup on inexisting type" do
|
it "should fail lookup on inexisting type" do
|
||||||
#expect_any_instance_of(Cabin::Channel).to receive(:debug).once
|
#expect_any_instance_of(Cabin::Channel).to receive(:debug).once
|
||||||
expect { LogStash::Plugin.lookup("badbadtype", "badname") }.to raise_error(LogStash::PluginLoadingError)
|
expect { LogStash::Plugin.lookup("badbadtype", "badname") }.to raise_error(LogStash::PluginLoadingError)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue