# File lib/fluent/test/input_test.rb, line 40 def emits all = [] @emit_streams.each {|tag,events| events.each {|time,record| all << [tag, time, record] } } all end
# File lib/fluent/test/input_test.rb, line 50 def events all = [] @emit_streams.each {|tag,events| all.concat events } all end
# File lib/fluent/test/input_test.rb, line 29 def expect_emit(tag, time, record) (@expects ||= []) << [tag, time, record] self end
# File lib/fluent/test/input_test.rb, line 34 def expected_emits @expects ||= [] end
# File lib/fluent/test/input_test.rb, line 58 def records all = [] @emit_streams.each {|tag,events| events.each {|time,record| all << record } } all end
# File lib/fluent/test/input_test.rb, line 68 def run(&block) m = method(:emit_stream) super { Engine.define_singleton_method(:emit_stream) {|tag,es| m.call(tag, es) } block.call if block if @expects i = 0 @emit_streams.each {|tag,events| events.each {|time,record| assert_equal(@expects[i], [tag, time, record]) i += 1 } } assert_equal @expects.length, i end } self end
Generated with the Darkfish Rdoc Generator 2.