diff options
Diffstat (limited to 'spec/lib/gitlab/ci/config/yaml/tags/reference_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/yaml/tags/reference_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/yaml/tags/reference_spec.rb b/spec/lib/gitlab/ci/config/yaml/tags/reference_spec.rb index c68dccd3455..bf89942bf14 100644 --- a/spec/lib/gitlab/ci/config/yaml/tags/reference_spec.rb +++ b/spec/lib/gitlab/ci/config/yaml/tags/reference_spec.rb @@ -69,6 +69,23 @@ RSpec.describe Gitlab::Ci::Config::Yaml::Tags::Reference do end end + context 'when the references are valid but do not match the config' do + let(:yaml) do + <<~YML + a: [1, 2] + b: [3, 4] + c: !reference [a, b] + YML + end + + it 'raises a MissingReferenceError' do + expect { subject }.to raise_error( + Gitlab::Ci::Config::Yaml::Tags::Reference::MissingReferenceError, + '!reference ["a", "b"] could not be found' + ) + end + end + context 'with arrays' do let(:yaml) do <<~YML |