Module: MotionSpec::TapOutput
- Defined in:
- lib/motion-spec/output/tap.rb
Constant Summary collapse
- @@count =
1
- @@describe =
''
Instance Method Summary collapse
- #handle_requirement_begin(description) ⇒ Object
- #handle_requirement_end(error) ⇒ Object
- #handle_specification_begin(name) ⇒ Object
- #handle_specification_end ⇒ Object
- #handle_summary ⇒ Object
Instance Method Details
#handle_requirement_begin(description) ⇒ Object
15 16 17 18 19 |
# File 'lib/motion-spec/output/tap.rb', line 15 def handle_requirement_begin(description) @description = @@describe + description @description.sub!(/^[#\s]+/, '') ErrorLog.replace '' end |
#handle_requirement_end(error) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/motion-spec/output/tap.rb', line 21 def handle_requirement_end(error) if error.empty? puts 'ok %-3d - %s' % [@@count, @description] else puts 'not ok %d - %s: %s' % [@@count, @description, error] puts ErrorLog.strip.gsub(/^/, '# ') if Backtraces end @@count += 1 end |
#handle_specification_begin(name) ⇒ Object
7 8 9 |
# File 'lib/motion-spec/output/tap.rb', line 7 def handle_specification_begin(name) @@describe << "#{name} " end |
#handle_specification_end ⇒ Object
11 12 13 |
# File 'lib/motion-spec/output/tap.rb', line 11 def handle_specification_end @@describe = '' end |