Welcome to mirror list, hosted at ThFree Co, Russian Federation.

type_name_deprecation_helpers.rb « helpers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 591737ab532a4162162de7900f76555d6b3ed2ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module TypeNameDeprecationHelpers
  def stub_type_name_deprecations(*deprecations)
    old_name_map = deprecations.index_by(&:old_name)
    new_name_map = deprecations.index_by(&:new_name)
    old_graphql_name_map = deprecations.index_by do |d|
      Gitlab::Graphql::TypeNameDeprecations.map_graphql_name(d.old_name)
    end

    stub_const('Gitlab::Graphql::TypeNameDeprecations::OLD_NAME_MAP', old_name_map)
    stub_const('Gitlab::Graphql::TypeNameDeprecations::NEW_NAME_MAP', new_name_map)
    stub_const('Gitlab::Graphql::TypeNameDeprecations::OLD_GRAPHQL_NAME_MAP', old_graphql_name_map)
  end
end