Parent

Included Modules

Class/Module Index [+]

Quicksearch

Fluent::Test::TestDriver

Attributes

config[R]
instance[R]

Public Class Methods

new(klass, &block) click to toggle source
# File lib/fluent/test/base.rb, line 25
def initialize(klass, &block)
  if klass.is_a?(Class)
    if block
      klass = klass.dup
      klass.module_eval(&block)
    end
    @instance = klass.new
  else
    @instance = klass
  end
  @config = Config.new
end

Public Instance Methods

configure(str) click to toggle source
# File lib/fluent/test/base.rb, line 40
def configure(str)
  if str.is_a?(Fluent::Config::Element)
    @config = str
  else
    @config = Config.parse(str, "(test)")
  end
  @instance.configure(@config)
  self
end
run(&block) click to toggle source
# File lib/fluent/test/base.rb, line 50
def run(&block)
  @instance.start
  begin
    # wait until thread starts
    10.times { sleep 0.05 }
    return yield
  ensure
    @instance.shutdown
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.