Sha256: cdd41e7573dfc17efded998d453f43b989622c0ea053b638dbe6a575d01ea7ea

Contents?: true

Size: 888 Bytes

Versions: 3

Compression:

Stored size: 888 Bytes

Contents

# frozen_string_literal: true

require_relative "../integration"
require_relative "patcher"

module Datadog
  module CI
    module Contrib
      module Knapsack
        # Knapsack Pro test runner instrumentation
        # https://github.com/KnapsackPro/knapsack_pro-ruby
        class Integration < Contrib::Integration
          MINIMUM_VERSION = Gem::Version.new("7.0.0")

          def version
            Gem.loaded_specs["knapsack_pro"]&.version
          end

          def loaded?
            !defined?(::KnapsackPro).nil? &&
              !defined?(::KnapsackPro::Extensions::RSpecExtension).nil? &&
              !defined?(::KnapsackPro::Extensions::RSpecExtension::Runner).nil?
          end

          def compatible?
            super && version >= MINIMUM_VERSION
          end

          def patcher
            Patcher
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datadog-ci-1.11.0 lib/datadog/ci/contrib/knapsack/integration.rb
datadog-ci-1.10.0 lib/datadog/ci/contrib/knapsack/integration.rb
datadog-ci-1.9.0 lib/datadog/ci/contrib/knapsack/integration.rb