# 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
# File lib/fluent/test/driver/multi_output.rb, line 46 def flush @instance.outputs.each{|o| o.force_flush } end
# 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
# File lib/fluent/test/driver/multi_output.rb, line 39 def run_actual(**kwargs, &block) super(**kwargs, &block) if @flush_buffer_at_cleanup @instance.outputs.each{|o| o.force_flush } end end