Module: Datadog::CI::Contrib::RSpec::Patcher

Includes:
Patcher
Defined in:
lib/datadog/ci/contrib/rspec/patcher.rb

Overview

Patcher enables patching of ‘rspec’ module.

Class Method Summary collapse

Methods included from Patcher

included

Class Method Details

.patchObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/datadog/ci/contrib/rspec/patcher.rb', line 20

def patch
  ::RSpec::Core::Runner.include(Runner)
  ::RSpec::Core::Example.include(Example)
  ::RSpec::Core::ExampleGroup.include(ExampleGroup)

  # only add DocumentationFormatter's patch if it's loaded at this point
  if defined?(::RSpec::Core::Formatters::DocumentationFormatter) &&
      defined?(::RSpec::Core::Formatters::BaseFormatter) &&
      defined?(::RSpec::Core::Formatters::BaseTextFormatter)
    ::RSpec::Core::Formatters::DocumentationFormatter.include(DocumentationFormatter)
  end
end