summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-15 14:57:22 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-18 13:17:48 +0200
commit1f3248644ef98879a8a4c31d5be0de9a774cc32a (patch)
tree77f2a58fc5ccd419b7a471711e5988ea67d8a606 /spec
parent3dec6e262984faa18b235db4bbd669ccdc80fc3f (diff)
downloadgitlab-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.rb12
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