Class: RSpec::Core::Formatters::BisectDRbFormatter

Inherits:
BaseBisectFormatter show all
Defined in:
lib/rspec/core/formatters/bisect_drb_formatter.rb

Overview

Used by `–bisect`. When it shells out and runs a portion of the suite, it uses this formatter as a means to have the status reported back to it, via DRb.

Note that since DRb calls carry considerable overhead compared to normal method calls, we try to minimize the number of DRb calls for perf reasons, opting to communicate only at the start and the end of the run, rather than after each example.

Instance Method Summary collapse

Methods inherited from BaseBisectFormatter

#example_failed, #example_finished, inherited, #start_dump

Constructor Details

#initialize(_output) ⇒ BisectDRbFormatter



16
17
18
19
20
21
# File 'lib/rspec/core/formatters/bisect_drb_formatter.rb', line 16

def initialize(_output)
  drb_uri = "druby://localhost:#{RSpec.configuration.drb_port}"
  @bisect_server = DRbObject.new_with_uri(drb_uri)
  RSpec.configuration.files_or_directories_to_run = @bisect_server.files_or_directories_to_run
  super(Set.new(@bisect_server.expected_failures))
end

Instance Method Details

#notify_results(results) ⇒ Object



23
24
25
# File 'lib/rspec/core/formatters/bisect_drb_formatter.rb', line 23

def notify_results(results)
  @bisect_server.latest_run_results = results
end