Module: Bacon::TapOutput

Defined in:
lib/bacon.rb

Instance Method Summary collapse

Instance Method Details

#handle_requirement(description) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/bacon.rb', line 86

def handle_requirement(description)
  ErrorLog.replace ""
  error = yield
  if error.empty?
    puts "ok %-3d - %s" % [Counter[:specifications], description]
  else
    puts "not ok %d - %s: %s" %
      [Counter[:specifications], description, error]
    puts ErrorLog.strip.gsub(/^/, '# ')  if Backtraces
  end
end

#handle_specification(name) ⇒ Object



84
# File 'lib/bacon.rb', line 84

def handle_specification(name)  yield  end

#handle_summaryObject



98
99
100
101
102
# File 'lib/bacon.rb', line 98

def handle_summary
  puts "1..#{Counter[:specifications]}"
  puts "# %d tests, %d assertions, %d failures, %d errors" %
    Counter.values_at(:specifications, :requirements, :failed, :errors)
end