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

### Methods

add_example_group dump end example_failed example_finished example_started failure new start

### Classes and Modules

Class Spec::Runner::Reporter::Failure

### Attributes

example_groups | [R] |
options | [R] |

### Public Class methods

new(options)

[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

add_example_group(example_group)

[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

dump()

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

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

example_finished(example, error=nil)

[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

example_started(example)

[Source]

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

failure(example, error)

[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

start(number_of_examples)

[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]