diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-08-17 12:58:47 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-09-04 14:17:01 +0200 |
commit | 880865599f92285150e94f891cad326bf0239435 (patch) | |
tree | d793dba08e883013206f57b2d489f1a8225b211d /spec/lib/gitlab/ci/config/extendable | |
parent | d5eff68576361f43e5979bb713ecb823323c24bb (diff) | |
download | gitlab-ce-880865599f92285150e94f891cad326bf0239435.tar.gz |
Add test case describing circular dependency in `extends`
Diffstat (limited to 'spec/lib/gitlab/ci/config/extendable')
-rw-r--r-- | spec/lib/gitlab/ci/config/extendable/entry_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/extendable/entry_spec.rb b/spec/lib/gitlab/ci/config/extendable/entry_spec.rb index 39b3aec3165..2726d91f6d6 100644 --- a/spec/lib/gitlab/ci/config/extendable/entry_spec.rb +++ b/spec/lib/gitlab/ci/config/extendable/entry_spec.rb @@ -185,5 +185,16 @@ describe Gitlab::Ci::Config::Extendable::Entry do expect(hash).to eq original end end + + context 'when circular depenency gets detected' do + let(:hash) do + { test: { extends: 'test' } } + end + + it 'raises an error' do + expect { subject.extend! } + .to raise_error(StandardError, /Circular dependency detected/) + end + end end end |