class RSpec::Core::Formatters::BaseBisectFormatter
@private
method.
Subclasses must define a ‘notify_results(all_example_ids, failed_example_ids)`
back to the bisect runner.
Contains common logic for formatters used by `–bisect` to communicate results
def self.inherited(formatter)
def self.inherited(formatter) Formatters.register formatter, :start_dump, :example_failed, :example_finished end
def example_failed(notification)
def example_failed(notification) @failed_example_ids << notification.example.id end
def example_finished(notification)
def example_finished(notification) @all_example_ids << notification.example.id return unless @remaining_failures.include?(notification.example.id) @remaining_failures.delete(notification.example.id) status = notification.example.execution_result.status return if status == :failed && !@remaining_failures.empty? RSpec.world.wants_to_quit = true end
def initialize(expected_failures)
def initialize(expected_failures) @all_example_ids = [] @failed_example_ids = [] @remaining_failures = expected_failures end
def start_dump(_notification)
def start_dump(_notification) # `notify_results` is defined in the subclass notify_results(Bisect::ExampleSetDescriptor.new( @all_example_ids, @failed_example_ids)) end