diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-07 08:29:43 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-07 08:29:43 +1100 |
commit | 295cecfb56af4e064340d255140a28959c47b25d (patch) | |
tree | f88460655eddc755c56234c92b5e5f393867ede5 /spec | |
parent | 1005389f70070245092c1ae5f3f9b10b8e7c102e (diff) | |
download | gitlab-ce-295cecfb56af4e064340d255140a28959c47b25d.tar.gz |
Allow numeric values in gitlab-ci.yml
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/global_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/variables_spec.rb | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/global_spec.rb b/spec/lib/gitlab/ci/config/entry/global_spec.rb index 684d01e9056..7678d6ebe30 100644 --- a/spec/lib/gitlab/ci/config/entry/global_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/global_spec.rb @@ -113,7 +113,7 @@ describe Gitlab::Ci::Config::Entry::Global do describe '#variables_value' do it 'returns variables' do - expect(global.variables_value).to eq(VAR: 'value') + expect(global.variables_value).to eq('VAR' => 'value') end end @@ -154,7 +154,7 @@ describe Gitlab::Ci::Config::Entry::Global do services: ['postgres:9.1', 'mysql:5.5'], stage: 'test', cache: { key: 'k', untracked: true, paths: ['public/'] }, - variables: { VAR: 'value' }, + variables: { 'VAR' => 'value' }, ignore: false, after_script: ['make clean'] }, spinach: { name: :spinach, diff --git a/spec/lib/gitlab/ci/config/entry/variables_spec.rb b/spec/lib/gitlab/ci/config/entry/variables_spec.rb index f15f02f403e..84bfef9e8ad 100644 --- a/spec/lib/gitlab/ci/config/entry/variables_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/variables_spec.rb @@ -13,6 +13,14 @@ describe Gitlab::Ci::Config::Entry::Variables do it 'returns hash with key value strings' do expect(entry.value).to eq config end + + context 'with numeric keys and values in the config' do + let(:config) { { 10 => 20 } } + + it 'converts numeric key and numeric value into strings' do + expect(entry.value).to eq('10' => '20') + end + end end describe '#errors' do |