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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-18 18:08:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-18 18:08:51 +0300
commit163a7046ac76eb4109184e82ce0af911633e6626 (patch)
tree9f22bb438db435d518e8f5520b309c6319ae0bd8 /spec/lib/gitlab/ci
parent0637ba1e6e9024f35b2cbf561d9002ec17350bb3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci')
-rw-r--r--spec/lib/gitlab/ci/templates/templates_spec.rb50
1 files changed, 30 insertions, 20 deletions
diff --git a/spec/lib/gitlab/ci/templates/templates_spec.rb b/spec/lib/gitlab/ci/templates/templates_spec.rb
index b52064b3036..bc3d5b89220 100644
--- a/spec/lib/gitlab/ci/templates/templates_spec.rb
+++ b/spec/lib/gitlab/ci/templates/templates_spec.rb
@@ -2,33 +2,43 @@
require 'spec_helper'
-describe "CI YML Templates" do
- using RSpec::Parameterized::TableSyntax
-
+describe 'CI YML Templates' do
subject { Gitlab::Ci::YamlProcessor.new(content) }
- where(:template_name) do
- Gitlab::Template::GitlabCiYmlTemplate.all.map(&:full_name)
- end
-
- with_them do
- let(:content) do
- <<~EOS
- include:
- - template: #{template_name}
+ let(:all_templates) { Gitlab::Template::GitlabCiYmlTemplate.all.map(&:full_name) }
- concrete_build_implemented_by_a_user:
- stage: test
- script: do something
- EOS
+ let(:disabled_templates) do
+ Gitlab::Template::GitlabCiYmlTemplate.disabled_templates.map do |template|
+ template + Gitlab::Template::GitlabCiYmlTemplate.extension
end
+ end
+
+ context 'included in a CI YAML configuration' do
+ using RSpec::Parameterized::TableSyntax
- it 'is valid' do
- expect { subject }.not_to raise_error
+ where(:template_name) do
+ all_templates - disabled_templates
end
- it 'require default stages to be included' do
- expect(subject.stages).to include(*Gitlab::Ci::Config::Entry::Stages.default)
+ with_them do
+ let(:content) do
+ <<~EOS
+ include:
+ - template: #{template_name}
+
+ concrete_build_implemented_by_a_user:
+ stage: test
+ script: do something
+ EOS
+ end
+
+ it 'is valid' do
+ expect { subject }.not_to raise_error
+ end
+
+ it 'require default stages to be included' do
+ expect(subject.stages).to include(*Gitlab::Ci::Config::Entry::Stages.default)
+ end
end
end
end