diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 09:07:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 09:07:57 +0000 |
commit | 7881eb30eaa8b01dbcfe87faa09927c75c7d6e45 (patch) | |
tree | 298bc8d2c62b2f2c29cb8ecbcf3de3eaaa6466d9 /spec/lib/gitlab/ci/build/credentials/factory_spec.rb | |
parent | 64b66e0cb6d1bfd27abf24e06653f00bddb60597 (diff) | |
download | gitlab-ce-7881eb30eaa8b01dbcfe87faa09927c75c7d6e45.tar.gz |
Add latest changes from gitlab-org/gitlab@12-6-stable-ee
Diffstat (limited to 'spec/lib/gitlab/ci/build/credentials/factory_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/build/credentials/factory_spec.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/lib/gitlab/ci/build/credentials/factory_spec.rb b/spec/lib/gitlab/ci/build/credentials/factory_spec.rb index 9148c0d579e..848adb2e6e5 100644 --- a/spec/lib/gitlab/ci/build/credentials/factory_spec.rb +++ b/spec/lib/gitlab/ci/build/credentials/factory_spec.rb @@ -12,12 +12,16 @@ describe Gitlab::Ci::Build::Credentials::Factory do end before do - allow_any_instance_of(described_class).to receive(:providers).and_return([TestProvider]) + allow_next_instance_of(described_class) do |instance| + allow(instance).to receive(:providers).and_return([TestProvider]) + end end context 'when provider is valid' do before do - allow_any_instance_of(TestProvider).to receive(:valid?).and_return(true) + allow_next_instance_of(TestProvider) do |instance| + allow(instance).to receive(:valid?).and_return(true) + end end it 'generates an array of credentials objects' do @@ -29,7 +33,9 @@ describe Gitlab::Ci::Build::Credentials::Factory do context 'when provider is not valid' do before do - allow_any_instance_of(TestProvider).to receive(:valid?).and_return(false) + allow_next_instance_of(TestProvider) do |instance| + allow(instance).to receive(:valid?).and_return(false) + end end it 'generates an array without specific credential object' do |