Module: SpecDoxOutput

Included in:
Bacon
Defined in:
lib/output/spec_dox_output.rb

Instance Method Summary collapse

Instance Method Details

#handle_requirement(description) ⇒ Object



8
9
10
11
12
13
# File 'lib/output/spec_dox_output.rb', line 8

def handle_requirement(description)
  print "#{spaces}  - #{description}"
  timing = []
  error = yield(timing)
  puts error.empty? ? "" : " [#{error}]"
end

#handle_specification(name) ⇒ Object



2
3
4
5
6
# File 'lib/output/spec_dox_output.rb', line 2

def handle_specification(name)
  puts spaces + name
  yield
  puts if Counter[:context_depth] == 1
end

#handle_summary(started_at) ⇒ Object



15
16
17
18
19
# File 'lib/output/spec_dox_output.rb', line 15

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

#spacesObject



21
22
23
# File 'lib/output/spec_dox_output.rb', line 21

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