mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
add comments
This commit is contained in:
parent
372e1d73ff
commit
619a590c72
1 changed files with 8 additions and 0 deletions
|
@ -136,6 +136,10 @@ describe LogStash::Event do
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
# noop logger used to test the injectable logger in Event
|
||||
# this implementation is not complete because only the warn
|
||||
# method is used in Event.
|
||||
module DummyLogger
|
||||
def self.warn(message)
|
||||
# do nothing
|
||||
|
@ -147,6 +151,10 @@ describe LogStash::Event do
|
|||
let(:logger) { double("Logger") }
|
||||
after(:each) { LogStash::Event.logger = nil }
|
||||
|
||||
# the following 2 specs are using both a real module (DummyLogger)
|
||||
# and a mock. both tests are needed to make sure the implementation
|
||||
# supports both types of objects.
|
||||
|
||||
it "should set logger using a module" do
|
||||
LogStash::Event.logger = DummyLogger
|
||||
expect(DummyLogger).to receive(:warn).once
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue