Class: Datadog::CI::Contrib::RSpec::Integration
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
30
31
32
|
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 30
def compatible?
super && version >= MINIMUM_VERSION
end
|
#dependants ⇒ Object
15
16
17
|
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 15
def dependants
%i[knapsack ciqueue]
end
|
#loaded? ⇒ 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_configuration ⇒ Object
34
35
36
37
38
39
|
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 34
def new_configuration
settings = Configuration::Settings.new
settings.dry_run_enabled = true if test_discovery_component&.enabled?
settings
end
|
#patcher ⇒ Object
41
42
43
|
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 41
def patcher
Patcher
end
|
#test_discovery_component ⇒ Object
45
46
47
48
49
|
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 45
def test_discovery_component
components = Datadog.send(:components)
return nil unless components.respond_to?(:test_discovery)
components.test_discovery
end
|
#version ⇒ Object
19
20
21
|
# File 'lib/datadog/ci/contrib/rspec/integration.rb', line 19
def version
Gem.loaded_specs["rspec-core"]&.version
end
|