Module: Bacon::ImmediateRedGreenOutput
- Included in:
- Bacon
- Defined in:
- lib/data_objects/spec/helpers/immediate_red_green_output.rb
Instance Method Summary collapse
- #handle_requirement(description) ⇒ Object
- #handle_specification(name) ⇒ Object
- #handle_summary ⇒ Object
Instance Method Details
#handle_requirement(description) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/data_objects/spec/helpers/immediate_red_green_output.rb', line 9 def handle_requirement(description) error = yield if error.empty? example_passed elsif error == 'PENDING' example_pending else example_failed(error, description, Counter[:specifications]) end end |
#handle_specification(name) ⇒ Object
4 5 6 7 |
# File 'lib/data_objects/spec/helpers/immediate_red_green_output.rb', line 4 def handle_specification(name) yield @current_group = name end |
#handle_summary ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/data_objects/spec/helpers/immediate_red_green_output.rb', line 20 def handle_summary puts puts ErrorLog counter = Counter.values_at(:specifications, :requirements, :failed, :errors, :pending) = ("%d tests, %d assertions, %d failures, %d errors, %d pending" % counter) color = (counter[2].to_i != 0 || counter[3].to_i != 0 ? :red : (counter[4].to_i != 0 ? :yellow : :green)) puts self.send(color, ) end |