Class: Fluent::Test::OutputTestDriver

Inherits:
InputTestDriver show all
Defined in:
lib/fluent/test/output_test.rb

Instance Attribute Summary collapse

Attributes inherited from InputTestDriver

#emit_streams, #event_streams, #expected_emits_length, #run_timeout

Attributes inherited from TestDriver

#config, #instance

Instance Method Summary collapse

Methods inherited from InputTestDriver

#emits, #events, #expect_emit, #expected_emits, #records, #register_run_breaking_condition, #register_run_post_condition, #run, #run_should_stop?

Methods inherited from TestDriver

#configure, #run

Constructor Details

#initialize(klass, tag = 'test', &block) ⇒ OutputTestDriver

Returns a new instance of OutputTestDriver.



37
38
39
40
# File 'lib/fluent/test/output_test.rb', line 37

def initialize(klass, tag='test', &block)
  super(klass, &block)
  @tag = tag
end

Instance Attribute Details

#tagObject

Returns the value of attribute tag.



42
43
44
# File 'lib/fluent/test/output_test.rb', line 42

def tag
  @tag
end

Instance Method Details

#emit(record, time = EventTime.now) ⇒ Object



44
45
46
47
# File 'lib/fluent/test/output_test.rb', line 44

def emit(record, time=EventTime.now)
  es = OneEventStream.new(time, record)
  @instance.emit_events(@tag, es)
end