Class: Riot::StoryReporter

Inherits:
IOReporter show all
Defined in:
lib/riot/reporter.rb

Direct Known Subclasses

VerboseStoryReporter

Instance Attribute Summary

Attributes inherited from Reporter

#current_context, #errors, #failures, #passes

Instance Method Summary collapse

Methods inherited from IOReporter

#format_error, #initialize, #line_info, #print, #puts, #results

Methods inherited from Reporter

#initialize, #new, #report, #success?, #summarize

Constructor Details

This class inherits a constructor from Riot::IOReporter

Instance Method Details

#describe_context(context) ⇒ Object



79
80
81
82
# File 'lib/riot/reporter.rb', line 79

def describe_context(context)
  super
  puts context.detailed_description
end

#error(description, e) ⇒ Object



89
# File 'lib/riot/reporter.rb', line 89

def error(description, e) puts "  ! " + red("#{description}: #{e.message}"); end

#fail(description, message, line, file) ⇒ Object



85
86
87
# File 'lib/riot/reporter.rb', line 85

def fail(description, message, line, file)
  puts "  - " + yellow("#{description}: #{message} #{line_info(line, file)}".strip)
end

#pass(description, message) ⇒ Object



83
# File 'lib/riot/reporter.rb', line 83

def pass(description, message) puts "  + " + green("#{description} #{message}".strip); end