Parent

Class/Module Index [+]

Quicksearch

Spec::Runner::Reporter

Attributes

options[R]

Public Class Methods

new(options) click to toggle source
# File lib/spec/runner/reporter.rb, line 6
def initialize(options)
  @options = options
  @options.reporter = self
  @failures = []
  @pending_count = 0
  @example_count = 0
  @start_time = nil
  @end_time = nil
end

Public Instance Methods

dump() click to toggle source

Dumps the summary and returns the total number of failures

# File lib/spec/runner/reporter.rb, line 58
def dump
  formatters.each{|f| f.start_dump}
  dump_pending
  dump_failures
  formatters.each do |f|
    f.dump_summary(duration, @example_count, @failures.length, @pending_count)
    f.close
  end
  @failures.length
end
end() click to toggle source
# File lib/spec/runner/reporter.rb, line 53
def end
  @end_time = Time.new
end
example_failed(example, error) click to toggle source
# File lib/spec/runner/reporter.rb, line 39
def example_failed(example, error)
  backtrace_tweaker.tweak_backtrace(error)
  failure = Failure.new(@example_group.description, example.description, error)
  @failures << failure
  formatters.each do |f|
    f.example_failed(example, @failures.length, failure)
  end
end
example_finished(example, error=nil) click to toggle source
# File lib/spec/runner/reporter.rb, line 27
def example_finished(example, error=nil)
  @example_count += 1
  
  if error.nil?
    example_passed(example)
  elsif Spec::Example::ExamplePendingError === error
    example_pending(example, example.location, error.message)
  else
    example_failed(example, error)
  end
end
example_group_started(example_group) click to toggle source
# File lib/spec/runner/reporter.rb, line 16
def example_group_started(example_group)
  @example_group = example_group
  formatters.each do |f|
    f.example_group_started(example_group)
  end
end
example_started(example) click to toggle source
# File lib/spec/runner/reporter.rb, line 23
def example_started(example)
  formatters.each{|f| f.example_started(example)}
end
start(number_of_examples) click to toggle source
# File lib/spec/runner/reporter.rb, line 48
def start(number_of_examples)
  @start_time = Time.new
  formatters.each{|f| f.start(number_of_examples)}
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.