diff options
| author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-04-15 14:57:22 +0200 |
|---|---|---|
| committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-04-18 13:17:48 +0200 |
| commit | 1f3248644ef98879a8a4c31d5be0de9a774cc32a (patch) | |
| tree | 77f2a58fc5ccd419b7a471711e5988ea67d8a606 /spec | |
| parent | 3dec6e262984faa18b235db4bbd669ccdc80fc3f (diff) | |
| download | gitlab-ce-1f3248644ef98879a8a4c31d5be0de9a774cc32a.tar.gz | |
Make CI config return empty array if no job variables
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index ba5f7b0e09a..45f08c95cc3 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -380,6 +380,18 @@ module Ci expect(config.job_variables(:rspec)).to eq job_variables end end + + context 'when job variables are not defined' do + it 'returns empty array' do + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec" } + }) + + config_processor = GitlabCiYamlProcessor.new(config, path) + expect(config_processor.job_variables(:rspec)).to eq [] + end + end end describe "When" do |
