Parent

Class/Module Index [+]

Quicksearch

RSpec::Core::Reporter

Public Class Methods

new(*formatters) click to toggle source
# File lib/rspec/core/reporter.rb, line 3
def initialize(*formatters)
  @formatters = formatters
  @example_count = @failure_count = @pending_count = 0
  @duration = @start = nil
end

Public Instance Methods

abort() click to toggle source
Alias for: finish
example_failed(example) click to toggle source
# File lib/rspec/core/reporter.rb, line 58
def example_failed(example)
  @failure_count += 1
  notify :example_failed, example
end
example_group_finished(group) click to toggle source
# File lib/rspec/core/reporter.rb, line 45
def example_group_finished(group)
  notify :example_group_finished, group unless group.descendant_filtered_examples.empty?
end
example_group_started(group) click to toggle source
# File lib/rspec/core/reporter.rb, line 41
def example_group_started(group)
  notify :example_group_started, group unless group.descendant_filtered_examples.empty?
end
example_passed(example) click to toggle source
# File lib/rspec/core/reporter.rb, line 54
def example_passed(example)
  notify :example_passed, example
end
example_pending(example) click to toggle source
# File lib/rspec/core/reporter.rb, line 63
def example_pending(example)
  @pending_count += 1
  notify :example_pending, example
end
example_started(example) click to toggle source
# File lib/rspec/core/reporter.rb, line 49
def example_started(example)
  @example_count += 1
  notify :example_started, example
end
finish() click to toggle source
# File lib/rspec/core/reporter.rb, line 18
def finish
  begin
    stop
    notify :start_dump
    notify :dump_pending
    notify :dump_failures
    notify :dump_summary, @duration, @example_count, @failure_count, @pending_count
  ensure
    notify :close
  end
end
Also aliased as: abort
message(message) click to toggle source
# File lib/rspec/core/reporter.rb, line 37
def message(message)
  notify :message, message
end
notify(method, *args, &block) click to toggle source
# File lib/rspec/core/reporter.rb, line 73
def notify(method, *args, &block)
  @formatters.each do |formatter|
    formatter.send method, *args, &block
  end
end
report(count) click to toggle source
# File lib/rspec/core/reporter.rb, line 9
def report(count)
  start(count)
  begin
    yield self
  ensure
    finish
  end
end
start(expected_example_count) click to toggle source
# File lib/rspec/core/reporter.rb, line 32
def start(expected_example_count)
  @start = Time.now
  notify :start, expected_example_count
end
stop() click to toggle source
# File lib/rspec/core/reporter.rb, line 68
def stop
  @duration = Time.now - @start if @start
  notify :stop
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.