Class: Ramaze::SpecLogger

Inherits:
Object show all
Includes:
Enumerable, Logging
Defined in:
lib/ramaze/spec/helper/pretty_output.rb

Overview

Special Logger, stores everything in its history

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#debug, #debug?, #dev, #error, #info, #shutdown, #tag_log, #warn

Constructor Details

#initializeSpecLogger

Create new history



62
63
64
# File 'lib/ramaze/spec/helper/pretty_output.rb', line 62

def initialize
  @history = []
end

Instance Attribute Details

#historyObject

Returns the value of attribute history.



59
60
61
# File 'lib/ramaze/spec/helper/pretty_output.rb', line 59

def history
  @history
end

Instance Method Details

#eachObject

Yield the history



67
68
69
# File 'lib/ramaze/spec/helper/pretty_output.rb', line 67

def each
  @history.each{|e| yield(e) }
end

#log(tag, str) ⇒ Object

general log



72
73
74
# File 'lib/ramaze/spec/helper/pretty_output.rb', line 72

def log(tag, str)
  @history << [tag, str]
end