Class: RoadForest::TraceFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/roadforest/test-support/trace-formatter.rb

Defined Under Namespace

Classes: Grouper

Constant Summary collapse

DECISION_NAMES =
{
  :b13 => "Service available?",
  :b12 => "Known method?",
  :b11 => "URI too long?",
  :b10 => "Method allowed?",
  :b9 => "Content-MD5 present?",
  :b9a => "Content-MD5 valid?",
  :b9b => "Malformed?",
  :b8 => "Authorized?",
  :b7 => "Forbidden?",
  :b6 => "Okay Content-* Headers?",
  :b5 => "Known Content-Type?",
  :b4 => "Req Entity Too Large?",
  :b3 => "OPTIONS?",
  :c3 => "Accept exists?",
  :c4 => "Acceptable media type available?",
  :d4 => "Accept-Language exists?",
  :d5 => "Acceptable language available?",
  :e5 => "Accept-Charset exists?",
  :e6 => "Acceptable Charset available?",
  :f6 => "Accept-Encoding exists? (also, set content-type header here, now that charset is chosen)",
  :f7 => "Acceptable encoding available?",
  :g7 => "Resource exists?",
  :g8 => "If-Match exists?",
  :g9 => "If-Match: * exists?",
  :g11 => "ETag in If-Match",
  :h7 => "If-Match exists?",
  :h10 => "If-Unmodified-Since exists?",
  :h12 => "Last-Modified > I-UM-S?",
  :i4 => "Moved permanently? (apply PUT to different URI)",
  :i7 => "PUT?",
  :i12 => "If-none-match exists?",
  :i13 => "If-none-match: * exists?",
  :j18 => "GET or HEAD?",
  :k5 => "Moved permanently?",
  :k7 => "Previously existed?",
  :k13 => "Etag in if-none-match?",
  :l5 => "Moved temporarily?",
  :l7 => "POST?",
  :l13 => "If-Modified-Since exists?",
  :l15 => "IMS > Now?",
  :l17 => "Last-Modified > IMS?",
  :m5 => "POST?",
  :m7 => "Server allows POST to missing resource?",
  :m16 => "DELETE?",
  :m20 => "DELETE enacted immediately? (Also where DELETE is forced.)",
  :m20b => "Did the DELETE complete?",
  :n5 => "Server allows POST to missing resource?",
  :n11 => "Redirect?",
  :n16 => "POST?",
  :o14 => "Conflict?",
  :o16 => "PUT?",
  :o18 => "Multiple representations? Also where body generation for GET and HEAD is done.",
  :o18b => "Multiple choices?",
  :o20 => "Response includes an entity?",
  :p3 => "Conflict?",
  :p11 => "New resource?",
}

Instance Method Summary collapse

Constructor Details

#initialize(trace) ⇒ TraceFormatter

Returns a new instance of TraceFormatter.



62
63
64
# File 'lib/roadforest/test-support/trace-formatter.rb', line 62

def initialize(trace)
  @trace = trace
end

Instance Method Details

#to_sObject



66
67
68
# File 'lib/roadforest/test-support/trace-formatter.rb', line 66

def to_s
  Grouper.new(@trace).to_a.join("\n")
end