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:
authorMatija Čupić <matteeyah@gmail.com>2018-09-07 22:33:06 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-09-07 22:33:06 +0300
commiteca73d2b30a62876a3148bd1a8b1dfd6d48977fe (patch)
tree3577594e28eeaf0fd0c78f8946b7d49884f33fb9 /spec/lib/gitlab/ci/config_spec.rb
parent95b296f8ac8578e142efd6a60a582be4da5b09be (diff)
Address MR comments
CE mirror of 1269dc47b7f8d1a9913de326c9bd356d3e603663
Diffstat (limited to 'spec/lib/gitlab/ci/config_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config_spec.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/spec/lib/gitlab/ci/config_spec.rb b/spec/lib/gitlab/ci/config_spec.rb
index b1c801ff052..6e1edf76c19 100644
--- a/spec/lib/gitlab/ci/config_spec.rb
+++ b/spec/lib/gitlab/ci/config_spec.rb
@@ -126,7 +126,7 @@ describe Gitlab::Ci::Config do
end
end
- context "when yml has valid 'includes' defined" do
+ context "when yml has valid 'include' defined" do
let(:http_file_content) do
<<~HEREDOC
variables:
@@ -140,9 +140,8 @@ describe Gitlab::Ci::Config do
let(:local_file_content) { File.read("#{Rails.root}/spec/ee/fixtures/gitlab/ci/external_files/.gitlab-ci-template-1.yml") }
let(:yml) do
<<-EOS
- includes:
+ include:
- /spec/fixtures/gitlab/ci/external_files/.gitlab-ci-template-1.yml
- - /spec/fixtures/gitlab/ci/external_files/.gitlab-ci-template-2.yml
- https://gitlab.com/gitlab-org/gitlab-ce/blob/1234/.gitlab-ci-1.yml
image: ruby:2.2
@@ -151,7 +150,7 @@ describe Gitlab::Ci::Config do
before do
allow_any_instance_of(::Gitlab::Ci::ExternalFiles::ExternalFile).to receive(:local_file_content).and_return(local_file_content)
- allow_any_instance_of(Kernel).to receive_message_chain(:open, :read).and_return(http_file_content)
+ allow(HTTParty).to receive(:get).and_return(http_file_content)
end
it 'should return a composed hash' do
@@ -179,17 +178,17 @@ describe Gitlab::Ci::Config do
end
end
- context "when yml has invalid 'includes' defined" do
+ context "when yml has invalid 'include' defined" do
let(:yml) do
<<-EOS
- includes: invalid
+ include: invalid
EOS
end
- it 'raises error' do
+ it 'raises error YamlProcessor ValidationError' do
expect { config }.to raise_error(
- ::Gitlab::Ci::ExternalFiles::Processor::ExternalFileError,
- /External files should be a valid local or remote file/
+ ::Gitlab::Ci::YamlProcessor::ValidationError,
+ "External file: 'invalid' should be a valid local or remote file"
)
end
end