Module: Selective::Ruby::RSpec::Monkeypatches::Reporter

Defined in:
lib/selective/ruby/rspec/monkeypatches.rb

Instance Method Summary collapse

Instance Method Details

#finishObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/selective/ruby/rspec/monkeypatches.rb', line 23

def finish
  return if Selective::Ruby::Core::Controller.suppress_reporting?
  # This handles the scenario of no tests to run
  start(nil) if @start.nil?
  if ::RSpec.configuration.profile_examples
    puts "\n\nExample group profiling is not supported with Selective and is now disabled.\n\n"
    ::RSpec.configuration.profile_examples = nil
  end

  super
end

#register_listener(listener, *notifications) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/selective/ruby/rspec/monkeypatches.rb', line 41

def register_listener(listener, *notifications)
  # Prevent double registration of listeners with
  # the same output path.
  filtered_notifications = notifications.reject do |n|
    @listeners[n.to_sym].any? do |l|
      next false unless [l, listener].all? do |x|
        x.respond_to?(:output) && x.output.respond_to?(:path)
      end

      # :nocov:
      l.output.path == listener.output.path
      # :nocov:
    end
  end

  super(listener, *filtered_notifications)
end

#start(*args) ⇒ Object



35
36
37
38
39
# File 'lib/selective/ruby/rspec/monkeypatches.rb', line 35

def start(*args)
  return if Selective::Ruby::Core::Controller.suppress_reporting?

  super
end