class Fluent::Test::Driver::MultiOutput

Public Class Methods

new(klass, opts: {}, &block) click to toggle source
Calls superclass method Fluent::Test::Driver::EventFeeder::new
# File lib/fluent/test/driver/multi_output.rb, line 28
def initialize(klass, opts: {}, &block)
  super
  raise ArgumentError, "plugin is not an instance of Fluent::Plugin::MultiOutput" unless @instance.is_a? Fluent::Plugin::MultiOutput
  @flush_buffer_at_cleanup = nil
end

Public Instance Methods

flush() click to toggle source
# File lib/fluent/test/driver/multi_output.rb, line 47
def flush
  @instance.outputs.each{|o| o.force_flush }
end
run(flush: true, **kwargs, &block) click to toggle source
Calls superclass method Fluent::Test::Driver::EventFeeder#run
# File lib/fluent/test/driver/multi_output.rb, line 34
def run(flush: true, **kwargs, &block)
  @flush_buffer_at_cleanup = flush
  super(**kwargs, &block)
end
run_actual(**kwargs, &block) click to toggle source
Calls superclass method Fluent::Test::Driver::Base#run_actual
# File lib/fluent/test/driver/multi_output.rb, line 39
def run_actual(**kwargs, &block)
  val = super(**kwargs, &block)
  if @flush_buffer_at_cleanup
    @instance.outputs.each{|o| o.force_flush }
  end
  val
end