Sha256: 66d1ab75d4617ffa3cf1b2099667ff1ac5a7a30ff00cd1f7395a4faa74abd560

Contents?: true

Size: 1.14 KB

Versions: 11

Compression:

Stored size: 1.14 KB

Contents

# typed: false

require_relative '../../../tracing/contrib/integration'

require_relative 'configuration/settings'
require_relative 'patcher'

module Datadog
  module CI
    module Contrib
      module RSpec
        # Description of RSpec integration
        class Integration
          include Datadog::Tracing::Contrib::Integration

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

          register_as :rspec, auto_patch: true

          def self.version
            Gem.loaded_specs['rspec-core'] \
              && Gem.loaded_specs['rspec-core'].version
          end

          def self.loaded?
            !defined?(::RSpec).nil? && !defined?(::RSpec::Core).nil? && \
              !defined?(::RSpec::Core::Example).nil?
          end

          def self.compatible?
            super && version >= MINIMUM_VERSION
          end

          # test environments should not auto instrument test libraries
          def auto_instrument?
            false
          end

          def new_configuration
            Configuration::Settings.new
          end

          def patcher
            Patcher
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.8.0 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.7.0 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.6.1 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.6.0 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.5.2 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.5.1 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.5.0 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.4.2 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.4.1 lib/datadog/ci/contrib/rspec/integration.rb
ddtrace-1.4.0 lib/datadog/ci/contrib/rspec/integration.rb