diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-08-17 12:53:04 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-09-04 14:17:01 +0200 |
commit | d5eff68576361f43e5979bb713ecb823323c24bb (patch) | |
tree | 492fb7f829b98d067ff912f0d69626f44c6c5ea4 /spec/lib/gitlab/ci/config/extendable | |
parent | a24d4b3c674452ecb63f5a250b619362cc24630c (diff) | |
download | gitlab-ce-d5eff68576361f43e5979bb713ecb823323c24bb.tar.gz |
Improve extended CI/CD config specs and fix a bug
Diffstat (limited to 'spec/lib/gitlab/ci/config/extendable')
-rw-r--r-- | spec/lib/gitlab/ci/config/extendable/collection_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/extendable/entry_spec.rb | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/spec/lib/gitlab/ci/config/extendable/collection_spec.rb b/spec/lib/gitlab/ci/config/extendable/collection_spec.rb index 20483800315..a47a49fc03a 100644 --- a/spec/lib/gitlab/ci/config/extendable/collection_spec.rb +++ b/spec/lib/gitlab/ci/config/extendable/collection_spec.rb @@ -179,7 +179,7 @@ describe Gitlab::Ci::Config::Extendable::Collection do end end - context 'when extensible entry has non-hash inheritace defined' do + context 'when extensible entry has non-hash inheritance defined' do let(:hash) do { test: { diff --git a/spec/lib/gitlab/ci/config/extendable/entry_spec.rb b/spec/lib/gitlab/ci/config/extendable/entry_spec.rb index 7cc6e3f01f1..39b3aec3165 100644 --- a/spec/lib/gitlab/ci/config/extendable/entry_spec.rb +++ b/spec/lib/gitlab/ci/config/extendable/entry_spec.rb @@ -115,13 +115,13 @@ describe Gitlab::Ci::Config::Extendable::Entry do let(:hash) do { first: 'my value', - second: { extends: 'first' }, - test: { extends: 'second' } + test: { extends: 'first' } } end it 'raises an error' do - expect { subject.extend! }.to raise_error(StandardError) + expect { subject.extend! } + .to raise_error(StandardError, /Invalid base hash/) end end @@ -131,7 +131,8 @@ describe Gitlab::Ci::Config::Extendable::Entry do end it 'raises an error' do - expect { subject.extend! }.to raise_error(StandardError) + expect { subject.extend! } + .to raise_error(StandardError, /Unknown extends key/) end end @@ -177,7 +178,7 @@ describe Gitlab::Ci::Config::Extendable::Entry do end it 'does not mutate orignal context' do - original = hash.dup + original = hash.deep_dup subject.extend! |