Class: Log4r::StringOutputter

Inherits:
StdoutOutputter
  • Object
show all
Defined in:
lib/minitest/log4r.rb

Overview

Define a new Log4r-outputter to catch data into an String.

Instance Method Summary collapse

Instance Method Details

#flushObject

Clear message string and return messages.



24
25
26
27
28
29
# File 'lib/minitest/log4r.rb', line 24

def flush
  @messages ||= ''  #create with first call
  messages = @messages.dup
  @messages = ''
  messages.empty? ? nil : messages
end

#write(message) ⇒ Object

Collect messages in array.



17
18
19
20
# File 'lib/minitest/log4r.rb', line 17

def write(message)
  @messages ||= ''  #create with first call
  @messages  << message
end