Class | Spec::Runner::Reporter |
In: |
lib/spec/runner/reporter.rb
|
Parent: | Object |
# File lib/spec/runner/reporter.rb, line 5 5: def initialize(formatter, backtrace_tweaker) 6: @formatter = formatter 7: @backtrace_tweaker = backtrace_tweaker 8: clear! 9: end
# File lib/spec/runner/reporter.rb, line 11 11: def add_context(name) 12: #TODO - @context_names.empty? tells the formatter whether this is the first context or not - that's a little slippery 13: @formatter.add_context(name, @context_names.empty?) 14: @context_names << name 15: end
Dumps the summary and returns the total number of failures
# File lib/spec/runner/reporter.rb, line 42 42: def dump 43: @formatter.start_dump 44: dump_failures 45: @formatter.dump_summary(duration, @spec_names.length, @failures.length) 46: @failures.length 47: end
# File lib/spec/runner/reporter.rb, line 22 22: def spec_finished(name, error=nil, failure_location=nil) 23: if error.nil? 24: spec_passed(name) 25: else 26: @backtrace_tweaker.tweak_backtrace(error, failure_location) 27: spec_failed(name, Failure.new(@context_names.last, name, error)) 28: end 29: end
# File lib/spec/runner/reporter.rb, line 17 17: def spec_started(name) 18: @spec_names << name 19: @formatter.spec_started(name) 20: end