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>2019-12-07 03:07:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-07 03:07:51 +0300
commit4e375367b78bb44bd00957522cd9fc3e6d403fef (patch)
tree059b1ce541e4128bf03683407d7b5bbbc2094ed5 /spec/lib/gitlab/ci/config_spec.rb
parent99ddca0d88f1e4e49d61b1aa9d41b5785528d1dc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci/config_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config_spec.rb28
1 files changed, 11 insertions, 17 deletions
diff --git a/spec/lib/gitlab/ci/config_spec.rb b/spec/lib/gitlab/ci/config_spec.rb
index b254f9af2f1..6594a3dfa8b 100644
--- a/spec/lib/gitlab/ci/config_spec.rb
+++ b/spec/lib/gitlab/ci/config_spec.rb
@@ -8,8 +8,9 @@ describe Gitlab::Ci::Config do
set(:user) { create(:user) }
before do
- allow_any_instance_of(Gitlab::Ci::Config::External::Context)
- .to receive(:check_execution_time!)
+ allow_next_instance_of(Gitlab::Ci::Config::External::Context) do |instance|
+ allow(instance).to receive(:check_execution_time!)
+ end
end
let(:config) do
@@ -358,18 +359,11 @@ describe Gitlab::Ci::Config do
context "when it takes too long to evaluate includes" do
before do
- allow_any_instance_of(Gitlab::Ci::Config::External::Context)
- .to receive(:check_execution_time!)
- .and_call_original
-
- allow_any_instance_of(Gitlab::Ci::Config::External::Context)
- .to receive(:set_deadline)
- .with(described_class::TIMEOUT_SECONDS)
- .and_call_original
-
- allow_any_instance_of(Gitlab::Ci::Config::External::Context)
- .to receive(:execution_expired?)
- .and_return(true)
+ allow_next_instance_of(Gitlab::Ci::Config::External::Context) do |instance|
+ allow(instance).to receive(:check_execution_time!).and_call_original
+ allow(instance).to receive(:set_deadline).with(described_class::TIMEOUT_SECONDS).and_call_original
+ allow(instance).to receive(:execution_expired?).and_return(true)
+ end
end
it 'raises error TimeoutError' do
@@ -384,9 +378,9 @@ describe Gitlab::Ci::Config do
context 'when context expansion timeout is disabled' do
before do
- allow_any_instance_of(Gitlab::Ci::Config::External::Context)
- .to receive(:check_execution_time!)
- .and_call_original
+ allow_next_instance_of(Gitlab::Ci::Config::External::Context) do |instance|
+ allow(instance).to receive(:check_execution_time!).and_call_original
+ end
allow(Feature)
.to receive(:enabled?)