Sha256: f586208b5a99e019fe7d4008b814c222a8326988a594f364f214999f6393629a

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/rspec/configuration/settings'
require 'ddtrace/contrib/rspec/patcher'
require 'ddtrace/contrib/integration'

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

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

        register_as :rspec, auto_patch: true

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

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

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

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

        def default_configuration
          Configuration::Settings.new
        end

        def patcher
          Patcher
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ddtrace-0.45.0 lib/ddtrace/contrib/rspec/integration.rb