Module: MotionSpec::SpecDoxOutput

Defined in:
lib/motion-spec/output/spec_dox.rb

Instance Method Summary collapse

Instance Method Details

#handle_requirement_begin(description) ⇒ Object



12
13
14
# File 'lib/motion-spec/output/spec_dox.rb', line 12

def handle_requirement_begin(description)
  print "#{spaces}  - #{description}"
end

#handle_requirement_end(error) ⇒ Object



16
17
18
# File 'lib/motion-spec/output/spec_dox.rb', line 16

def handle_requirement_end(error)
  puts error.empty? ? '' : " [#{error}]"
end

#handle_specification_begin(name) ⇒ Object



4
5
6
# File 'lib/motion-spec/output/spec_dox.rb', line 4

def handle_specification_begin(name)
  puts spaces + name
end

#handle_specification_endObject



8
9
10
# File 'lib/motion-spec/output/spec_dox.rb', line 8

def handle_specification_end
  puts if Counter[:context_depth] == 1
end

#handle_summaryObject



20
21
22
23
24
# File 'lib/motion-spec/output/spec_dox.rb', line 20

def handle_summary
  print ErrorLog if Backtraces
  puts '%d specifications (%d requirements), %d failures, %d errors' %
    Counter.values_at(:specifications, :requirements, :failed, :errors)
end

#spacesObject



26
27
28
# File 'lib/motion-spec/output/spec_dox.rb', line 26

def spaces
  '  ' * (Counter[:context_depth] - 1)
end