diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-08-16 14:48:38 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-09-04 14:17:00 +0200 |
commit | 58414c143f928aa229ae871541cd35df293d6f54 (patch) | |
tree | 445caa501a959f1802ac1727f01b46eb3c80df41 /spec/lib/gitlab/ci/config/extendable_spec.rb | |
parent | 5b9a6ca00a023493c750f9d4a3b06729fdc96fff (diff) | |
download | gitlab-ce-58414c143f928aa229ae871541cd35df293d6f54.tar.gz |
Support recursive `extends:` in `.gitlab-ci.yml`
Diffstat (limited to 'spec/lib/gitlab/ci/config/extendable_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/extendable_spec.rb | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/spec/lib/gitlab/ci/config/extendable_spec.rb b/spec/lib/gitlab/ci/config/extendable_spec.rb deleted file mode 100644 index a23fe560202..00000000000 --- a/spec/lib/gitlab/ci/config/extendable_spec.rb +++ /dev/null @@ -1,63 +0,0 @@ -require 'fast_spec_helper' - -describe Gitlab::Ci::Config::Extendable do - subject { described_class.new(hash) } - - describe '#each' do - context 'when there is extendable entry in the hash' do - let(:test) do - { extends: 'something', only: %w[master] } - end - - let(:hash) do - { something: { script: 'ls' }, test: test } - end - - it 'yields the test hash' do - expect { |b| subject.each(&b) } - .to yield_with_args(:test, :something, test) - end - end - - pending 'when not extending using a hash' - end - - describe '#extend!' do - context 'when a hash has a single simple extension' do - let(:hash) do - { - something: { - script: 'deploy', - only: { variables: %w[$SOMETHING] } - }, - test: { - extends: 'something', - script: 'ls', - only: { refs: %w[master] } - } - } - end - - it 'extends a hash with reverse merge' do - expect(subject.extend!).to eq( - something: { - script: 'deploy', - only: { variables: %w[$SOMETHING] } - }, - test: { - extends: 'something', - script: 'ls', - only: { - refs: %w[master], - variables: %w[$SOMETHING] - } - } - ) - end - end - - pending 'when a hash recursive extensions' - - pending 'when invalid `extends` is specified' - end -end |