Loading lib/labkit/fields.rb +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ module Labkit # # @return [Hash{String => String}] Hash mapping deprecated field names to standard field names def all @all = MAPPINGS.each_with_object({}) do |(key, values), result| @all ||= MAPPINGS.each_with_object({}) do |(key, values), result| values.each { |v| result[v] = key } end end Loading spec/labkit/fields_spec.rb +7 −0 Original line number Diff line number Diff line Loading @@ -34,5 +34,12 @@ RSpec.describe Labkit::Fields do expect(result).to be(Labkit::Fields::GL_USER_ID) end end describe 'MAPPINGS' do it 'has no duplicate deprecated field names' do all_deprecated = described_class::MAPPINGS.values.flatten expect(all_deprecated).to eq(all_deprecated.uniq) end end end end Loading
lib/labkit/fields.rb +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ module Labkit # # @return [Hash{String => String}] Hash mapping deprecated field names to standard field names def all @all = MAPPINGS.each_with_object({}) do |(key, values), result| @all ||= MAPPINGS.each_with_object({}) do |(key, values), result| values.each { |v| result[v] = key } end end Loading
spec/labkit/fields_spec.rb +7 −0 Original line number Diff line number Diff line Loading @@ -34,5 +34,12 @@ RSpec.describe Labkit::Fields do expect(result).to be(Labkit::Fields::GL_USER_ID) end end describe 'MAPPINGS' do it 'has no duplicate deprecated field names' do all_deprecated = described_class::MAPPINGS.values.flatten expect(all_deprecated).to eq(all_deprecated.uniq) end end end end