diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 23:51:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 23:51:20 +0300 |
commit | 3010dc9ecab0267dd17b82722a4c22c478ee9f07 (patch) | |
tree | 85f2c64d1e449cee42424ab6cda68396d18743d8 /spec | |
parent | 338041562770d6b88aec0e367f8378b4cdf5f918 (diff) |
Add latest changes from gitlab-org/gitlab@16-0-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab_settings/options_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab_settings/options_spec.rb b/spec/lib/gitlab_settings/options_spec.rb index 4b57e91c2e1..23cb2180edd 100644 --- a/spec/lib/gitlab_settings/options_spec.rb +++ b/spec/lib/gitlab_settings/options_spec.rb @@ -81,6 +81,20 @@ RSpec.describe GitlabSettings::Options, :aggregate_failures, feature_category: : end end + describe '#dup' do + it 'returns a deep copy' do + new_options = options.dup + expect(options.to_hash).to eq('foo' => { 'bar' => 'baz' }) + expect(new_options.to_hash).to eq(options.to_hash) + + new_options['test'] = 1 + new_options['foo']['bar'] = 'zzz' + + expect(options.to_hash).to eq('foo' => { 'bar' => 'baz' }) + expect(new_options.to_hash).to eq('test' => 1, 'foo' => { 'bar' => 'zzz' }) + end + end + describe '#merge' do it 'merges a hash to the existing options' do expect(options.merge(more: 'configs').to_hash).to eq( |