Module: TapOutput
- Defined in:
- lib/output/tap_output.rb
Instance Method Summary collapse
- #handle_requirement(description) ⇒ Object
- #handle_specification(name) ⇒ Object
- #handle_summary(started_at) ⇒ Object
Instance Method Details
#handle_requirement(description) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/output/tap_output.rb', line 4 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
2 |
# File 'lib/output/tap_output.rb', line 2 def handle_specification(name) yield end |
#handle_summary(started_at) ⇒ Object
16 17 18 19 20 |
# File 'lib/output/tap_output.rb', line 16 def handle_summary(started_at) puts "1..#{Counter[:specifications]}" puts "# %d tests, %d assertions, %d failures, %d errors" % Counter.values_at(:specifications, :requirements, :failed, :errors) end |