diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-15 12:08:09 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-15 12:08:09 +0000 |
commit | 37439afe69efe58e2351d899d231670d945be5e2 (patch) | |
tree | 0bb4989879fcc18396c013741a3a21c7cc1cb637 /spec/lib/gitlab/conflict/file_spec.rb | |
parent | 8353b844b31ebfa1181014e5a409ba93c22d8ad0 (diff) | |
download | gitlab-ce-37439afe69efe58e2351d899d231670d945be5e2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/conflict/file_spec.rb')
-rw-r--r-- | spec/lib/gitlab/conflict/file_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/lib/gitlab/conflict/file_spec.rb b/spec/lib/gitlab/conflict/file_spec.rb index 165305476d2..6ea8e6c6706 100644 --- a/spec/lib/gitlab/conflict/file_spec.rb +++ b/spec/lib/gitlab/conflict/file_spec.rb @@ -30,7 +30,7 @@ RSpec.describe Gitlab::Conflict::File do let(:section_keys) { conflict_file.sections.map { |section| section[:id] }.compact } context 'when resolving everything to the same side' do - let(:resolution_hash) { section_keys.to_h { |key| [key, 'head'] } } + let(:resolution_hash) { section_keys.index_with { 'head' } } let(:resolved_lines) { conflict_file.resolve_lines(resolution_hash) } let(:expected_lines) { conflict_file.lines.reject { |line| line.type == 'old' } } @@ -63,8 +63,8 @@ RSpec.describe Gitlab::Conflict::File do end it 'raises ResolutionError when passed a hash without resolutions for all sections' do - empty_hash = section_keys.to_h { |key| [key, nil] } - invalid_hash = section_keys.to_h { |key| [key, 'invalid'] } + empty_hash = section_keys.index_with { nil } + invalid_hash = section_keys.index_with { 'invalid' } expect { conflict_file.resolve_lines({}) } .to raise_error(Gitlab::Git::Conflict::Resolver::ResolutionError) |