Class: Spec::Runner::Formatter::SpreadsheetFormatter

Inherits:
BaseFormatter
  • Object
show all
Defined in:
lib/rasta/formatter/spreadsheet_formatter.rb

Constant Summary collapse

GREEN =
35
RED =
40
YELLOW =
19
NONE =
-4142

Instance Method Summary collapse

Instance Method Details

#cell=(c) ⇒ Object



11
12
13
# File 'lib/rasta/formatter/spreadsheet_formatter.rb', line 11

def cell=(c)
  @cell = c
end

#example_failed(example, counter, failure) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/rasta/formatter/spreadsheet_formatter.rb', line 15

def example_failed(example, counter, failure)
  if @cell 
    failure.exception.backtrace ? @cell.color = YELLOW : @cell.color = RED
    comment = "method: " + @cell.header + "()\n"
    comment += failure.exception.message.gsub(/,\s+/,",\n")  
    comment += "\n" + failure.exception.backtrace.join("\n") if failure.exception.backtrace
    @cell.comment = comment
  end
end

#example_passed(example) ⇒ Object



25
26
27
# File 'lib/rasta/formatter/spreadsheet_formatter.rb', line 25

def example_passed(example)
  @cell.color = GREEN if @cell && @cell.color == NONE 
end