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

Methods

Classes and Modules

Class Spec::Runner::Reporter::Failure

Attributes

example_groups  [R] 
options  [R] 

Public Class methods

[Source]

    # File lib/spec/runner/reporter.rb, line 6
 6:       def initialize(options)
 7:         @options = options
 8:         @options.reporter = self
 9:         clear
10:       end

Public Instance methods

[Source]

    # 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

[Source]

    # File lib/spec/runner/reporter.rb, line 56
56:       def dump
57:         formatters.each{|f| f.start_dump}
58:         dump_pending
59:         dump_failures
60:         formatters.each do |f|
61:           f.dump_summary(duration, @examples.length, @failures.length, @pending_count)
62:           f.close
63:         end
64:         @failures.length
65:       end

[Source]

    # File lib/spec/runner/reporter.rb, line 51
51:       def end
52:         @end_time = Time.new
53:       end
example_failed(example, error)

Alias for failure

[Source]

    # 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, error.message)
30:         else
31:           example_failed(example, error)
32:         end
33:       end

[Source]

    # File lib/spec/runner/reporter.rb, line 19
19:       def example_started(example)
20:         formatters.each{|f| f.example_started(example)}
21:       end

[Source]

    # File lib/spec/runner/reporter.rb, line 35
35:       def failure(example, error)
36:         backtrace_tweaker.tweak_backtrace(error)
37:         failure = Failure.new(example, error)
38:         @failures << failure
39:         formatters.each do |f|
40:           f.example_failed(example, @failures.length, failure)
41:         end
42:       end

[Source]

    # File lib/spec/runner/reporter.rb, line 45
45:       def start(number_of_examples)
46:         clear
47:         @start_time = Time.new
48:         formatters.each{|f| f.start(number_of_examples)}
49:       end

[Validate]