Sha256: 74003e47138ef253c7f85b2d5ceb5ca4faf035a4d3a55101351746793d219bed

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

# typed: false

require 'datadog/tracing/contrib/integration'

require 'datadog/ci/contrib/cucumber/configuration/settings'
require 'datadog/ci/contrib/cucumber/patcher'

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

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

          register_as :cucumber, auto_patch: true

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

          def self.loaded?
            !defined?(::Cucumber).nil? && !defined?(::Cucumber::Runtime).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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ddtrace-1.2.0 lib/datadog/ci/contrib/cucumber/integration.rb
ddtrace-1.1.0 lib/datadog/ci/contrib/cucumber/integration.rb
ddtrace-1.0.0 lib/datadog/ci/contrib/cucumber/integration.rb
ddtrace-1.0.0.beta2 lib/datadog/ci/contrib/cucumber/integration.rb