| Class | Spec::Runner::Reporter |
| In: |
lib/spec/runner/reporter.rb
|
| Parent: | Object |
| example_groups | [R] | |
| options | [R] |
# File lib/spec/runner/reporter.rb, line 6
6: def initialize(options)
7: @options = options
8: @options.reporter = self
9: clear
10: end
# File lib/spec/runner/reporter.rb, line 12
12: def add_example_group(example_group)
13: formatters.each do |f|
14: f.add_example_group(example_group)
15: end
16: example_groups << example_group
17: end
Dumps the summary and returns the total number of failures
# File lib/spec/runner/reporter.rb, line 57
57: def dump
58: formatters.each{|f| f.start_dump}
59: dump_pending
60: dump_failures
61: formatters.each do |f|
62: f.dump_summary(duration, @examples.length, @failures.length, @pending_count)
63: f.close
64: end
65: @failures.length
66: end
# File lib/spec/runner/reporter.rb, line 23
23: def example_finished(example, error=nil)
24: @examples << example
25:
26: if error.nil?
27: example_passed(example)
28: elsif Spec::Example::ExamplePendingError === error
29: example_pending(example_groups.last, example, error.message)
30: else
31: example_failed(example, error)
32: end
33: end
# File lib/spec/runner/reporter.rb, line 19
19: def example_started(example)
20: formatters.each{|f| f.example_started(example)}
21: end
# File lib/spec/runner/reporter.rb, line 35
35: def failure(example, error)
36: backtrace_tweaker.tweak_backtrace(error)
37: example_name = "#{example_groups.last.description} #{example.description}"
38: failure = Failure.new(example_name, error)
39: @failures << failure
40: formatters.each do |f|
41: f.example_failed(example, @failures.length, failure)
42: end
43: end