Sha256: 3464d27283a129edd352791a3bd2d60fd55c8fc0938f158b150471340d2f624c

Contents?: true

Size: 795 Bytes

Versions: 23

Compression:

Stored size: 795 Bytes

Contents

# frozen_string_literal: true

module KnapsackPro
  module TestCaseMergers
    class BaseMerger
      # values must be string to avoid circular dependency problem during loading files
      ADAPTER_TO_MERGER_MAP = {
        KnapsackPro::Adapters::RSpecAdapter => 'KnapsackPro::TestCaseMergers::RSpecMerger',
      }

      def self.call(adapter_class, test_files)
        merger_class =
          ADAPTER_TO_MERGER_MAP[adapter_class] ||
          raise("Test case merger does not exist for adapter_class: #{adapter_class}")
        Kernel.const_get(merger_class).new(test_files).call
      end

      def initialize(test_files)
        @test_files = test_files
      end

      def call
        raise NotImplementedError
      end

      private

      attr_reader :test_files
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
knapsack_pro-7.13.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.12.1 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.12.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.11.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.10.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.9.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.8.2 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.8.1 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.8.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.7.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.6.2 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.6.1 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.6.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.1.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.0.1 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-7.0.0 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-6.0.4 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-6.0.3 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-6.0.2 lib/knapsack_pro/test_case_mergers/base_merger.rb
knapsack_pro-6.0.1 lib/knapsack_pro/test_case_mergers/base_merger.rb