Class Spec::Runner::Reporter
In: lib/spec/runner/reporter.rb
Parent: Object

Methods

add_context   dump   end   new   spec_finished   spec_started   start  

Classes and Modules

Class Spec::Runner::Reporter::Failure

Public Class methods

[Source]

   # 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

Public Instance methods

[Source]

    # 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

[Source]

    # 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

[Source]

    # File lib/spec/runner/reporter.rb, line 37
37:       def end
38:         @end_time = Time.new
39:       end

[Source]

    # 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

[Source]

    # File lib/spec/runner/reporter.rb, line 17
17:       def spec_started(name)
18:         @spec_names << name
19:         @formatter.spec_started(name)
20:       end

[Source]

    # File lib/spec/runner/reporter.rb, line 31
31:       def start(number_of_specs)
32:         clear!
33:         @start_time = Time.new
34:         @formatter.start(number_of_specs)
35:       end

[Validate]