Class: Datadog::CI::Contrib::RSpec::Integration

Inherits:
Integration
  • Object
show all
Defined in:
lib/datadog/ci/contrib/rspec/integration.rb

Overview

Description of RSpec integration

Constant Summary collapse

MINIMUM_VERSION =
Gem::Version.new("3.0.0")

Instance Method Summary collapse

Methods inherited from Integration

#available?, #configuration, #configure, #enabled, inherited, #late_instrument?, #patchable?, #patched?

Instance Method Details

#compatible?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 30

def compatible?
  super && version >= MINIMUM_VERSION
end

#dependantsObject



15
16
17
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 15

def dependants
  %i[knapsack ciqueue]
end

#loaded?Boolean

Returns:

  • (Boolean)


23
24
25
26
27
28
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 23

def loaded?
  !defined?(::RSpec).nil? && !defined?(::RSpec::Core).nil? &&
    !defined?(::RSpec::Core::Example).nil? &&
    !defined?(::RSpec::Core::Runner).nil? &&
    !defined?(::RSpec::Core::ExampleGroup).nil?
end

#new_configurationObject



34
35
36
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 34

def new_configuration
  Configuration::Settings.new
end

#patcherObject



38
39
40
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 38

def patcher
  Patcher
end

#versionObject



19
20
21
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 19

def version
  Gem.loaded_specs["rspec-core"]&.version
end