diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-04 11:37:28 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-04 18:36:06 +0200 |
commit | bfad4c61f10f689868817cf0b94cddaa1de22240 (patch) | |
tree | d4915bee125f243c7a50f01718f2e556771c27b1 | |
parent | eb151e77ff389c3e22454145cfd55cfaa4be7948 (diff) | |
download | gitlab-ce-refactor/ci-config-move-global-entries.tar.gz |
Add minor improvements in readability in CI configrefactor/ci-config-move-global-entries
-rw-r--r-- | lib/gitlab/ci/config/node/configurable.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/config/node/stages.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/node/validator.rb | 1 | ||||
-rw-r--r-- | spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/node/boolean_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/node/configurable_spec.rb | 1 |
6 files changed, 6 insertions, 8 deletions
diff --git a/lib/gitlab/ci/config/node/configurable.rb b/lib/gitlab/ci/config/node/configurable.rb index 4889a21a234..37936fc8242 100644 --- a/lib/gitlab/ci/config/node/configurable.rb +++ b/lib/gitlab/ci/config/node/configurable.rb @@ -26,9 +26,7 @@ module Gitlab private def create_node(key, factory) - factory.with(value: @config[key]) - factory.with(parent: self) - factory.with(key: key) + factory.with(value: @config[key], key: key, parent: self) factory.create! end diff --git a/lib/gitlab/ci/config/node/stages.rb b/lib/gitlab/ci/config/node/stages.rb index 88d88252bce..b1fe45357ff 100644 --- a/lib/gitlab/ci/config/node/stages.rb +++ b/lib/gitlab/ci/config/node/stages.rb @@ -13,7 +13,7 @@ module Gitlab end def self.default - %w(build test deploy) + %w[build test deploy] end end end diff --git a/lib/gitlab/ci/config/node/validator.rb b/lib/gitlab/ci/config/node/validator.rb index 1ba2e1dc59d..758a6cf4356 100644 --- a/lib/gitlab/ci/config/node/validator.rb +++ b/lib/gitlab/ci/config/node/validator.rb @@ -23,6 +23,7 @@ module Gitlab def unknown_keys return [] unless config.is_a?(Hash) + config.keys - @node.class.nodes.keys end diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index 262a91fedff..33b9d5f8f22 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -551,8 +551,8 @@ module Ci config_processor = GitlabCiYamlProcessor.new(config, path) ## - # When variables config is empty, we asumme this is a correct, - # see issue #18775 + # When variables config is empty, we assume this is a valid + # configuration, see issue #18775 # expect(config_processor.job_variables(:rspec)) .to be_an_instance_of(Array).and be_empty diff --git a/spec/lib/gitlab/ci/config/node/boolean_spec.rb b/spec/lib/gitlab/ci/config/node/boolean_spec.rb index 32639296e6d..deafa8bf8a7 100644 --- a/spec/lib/gitlab/ci/config/node/boolean_spec.rb +++ b/spec/lib/gitlab/ci/config/node/boolean_spec.rb @@ -21,7 +21,7 @@ describe Gitlab::Ci::Config::Node::Boolean do end context 'when entry value is not valid' do - let(:config) { [ 'incorrect' ] } + let(:config) { ['incorrect'] } describe '#errors' do it 'saves errors' do diff --git a/spec/lib/gitlab/ci/config/node/configurable_spec.rb b/spec/lib/gitlab/ci/config/node/configurable_spec.rb index 4a1550517fb..c468ecf957b 100644 --- a/spec/lib/gitlab/ci/config/node/configurable_spec.rb +++ b/spec/lib/gitlab/ci/config/node/configurable_spec.rb @@ -22,7 +22,6 @@ describe Gitlab::Ci::Config::Node::Configurable do validator.validate end - context 'when node validator is invalid' do let(:instance) { node.new('ls') } |