Commit 36fb0d64 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add test for simple ciricular dependency in `extends`

parent 121b4fc1
...@@ -116,8 +116,7 @@ describe Gitlab::Ci::Config::Extendable::Collection do ...@@ -116,8 +116,7 @@ describe Gitlab::Ci::Config::Extendable::Collection do
end end
end end
pending 'when invalid `extends` is specified' context 'when nested circular dependecy has been detected' do
context 'when circular dependecy has been detected' do
let(:hash) do let(:hash) do
{ {
test: { test: {
...@@ -145,5 +144,24 @@ describe Gitlab::Ci::Config::Extendable::Collection do ...@@ -145,5 +144,24 @@ describe Gitlab::Ci::Config::Extendable::Collection do
.to raise_error(described_class::CircularDependencyError) .to raise_error(described_class::CircularDependencyError)
end end
end end
context 'when circular dependecy to self has been detected' do
let(:hash) do
{
test: {
extends: 'test',
script: 'ls',
only: { refs: %w[master] }
}
}
end
it 'raises an error' do
expect { subject.extend! }
.to raise_error(described_class::CircularDependencyError)
end
end
pending 'when invalid `extends` is specified'
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment