diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 14:22:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 14:22:11 +0000 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /spec/lib/gitlab/config | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) | |
download | gitlab-ce-0c872e02b2c822e3397515ec324051ff540f0cd5.tar.gz |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'spec/lib/gitlab/config')
-rw-r--r-- | spec/lib/gitlab/config/entry/attributable_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/lib/gitlab/config/entry/attributable_spec.rb b/spec/lib/gitlab/config/entry/attributable_spec.rb index 8a207bddaae..0a2f8ac2c3a 100644 --- a/spec/lib/gitlab/config/entry/attributable_spec.rb +++ b/spec/lib/gitlab/config/entry/attributable_spec.rb @@ -10,10 +10,11 @@ RSpec.describe Gitlab::Config::Entry::Attributable do end let(:instance) { node.new } + let(:prefix) { nil } before do - node.class_eval do - attributes :name, :test + node.class_exec(prefix) do |pre| + attributes :name, :test, prefix: pre end end @@ -24,6 +25,17 @@ RSpec.describe Gitlab::Config::Entry::Attributable do .and_return({ name: 'some name', test: 'some test' }) end + context 'and is provided a prefix' do + let(:prefix) { :pre } + + it 'returns the value of config' do + expect(instance).to have_pre_name + expect(instance.pre_name).to eq 'some name' + expect(instance).to have_pre_test + expect(instance.pre_test).to eq 'some test' + end + end + it 'returns the value of config' do expect(instance).to have_name expect(instance.name).to eq 'some name' |