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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-14 19:27:13 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-15 13:18:14 +0300
commit7b712d359880cb15bad4c0f01308bf12b1518e60 (patch)
treebdeac924e9cb9bcc51daa0a52ed7274465f5148d /spec/lib/gitlab/config
parent0cba9bef8a399e8f2003fee23fbda6f525921175 (diff)
Make default config entry value configurable
Introduce `default:` configuration entry setting that makes it possible to configure a default value of an entry, what overrides class-level `def self.default` value.
Diffstat (limited to 'spec/lib/gitlab/config')
-rw-r--r--spec/lib/gitlab/config/entry/configurable_spec.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/lib/gitlab/config/entry/configurable_spec.rb b/spec/lib/gitlab/config/entry/configurable_spec.rb
index 85a7cf1d241..09aa7f91b83 100644
--- a/spec/lib/gitlab/config/entry/configurable_spec.rb
+++ b/spec/lib/gitlab/config/entry/configurable_spec.rb
@@ -7,6 +7,10 @@ describe Gitlab::Config::Entry::Configurable do
end
end
+ before do
+ allow(entry).to receive(:default)
+ end
+
describe 'validations' do
context 'when entry is a hash' do
let(:instance) { entry.new(key: 'value') }
@@ -26,9 +30,11 @@ describe Gitlab::Config::Entry::Configurable do
end
describe 'configured entries' do
+ let(:another) { double('another', default: nil) }
+
before do
- entry.class_eval do
- entry :object, Object, description: 'test object'
+ entry.class_exec(another) do |another|
+ entry :object, another, description: 'test object'
end
end