Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-01 09:06:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-01 09:06:13 +0300
commit1dd77c7113eed7e229e0675ad8742c05cccfd1ee (patch)
treeb924852be9d5ea04bc58ed4af3b467690d167e26 /spec
parentec60358d52be0dc99f52db94dc95209f1486eac9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/utils/inline_hash_spec.rb18
-rw-r--r--spec/lib/gitlab/utils/safe_inline_hash_spec.rb2
2 files changed, 14 insertions, 6 deletions
diff --git a/spec/lib/gitlab/utils/inline_hash_spec.rb b/spec/lib/gitlab/utils/inline_hash_spec.rb
index 806117eddd0..867db0b92a5 100644
--- a/spec/lib/gitlab/utils/inline_hash_spec.rb
+++ b/spec/lib/gitlab/utils/inline_hash_spec.rb
@@ -9,9 +9,11 @@ describe Gitlab::Utils::InlineHash do
let(:source) do
{
nested_param: {
- key: 'Value'
+ key: :Value
},
'root_param' => 'Root',
+ unnested_symbol_key: :unnested_symbol_value,
+ 12 => 22,
'very' => {
'deep' => {
'nested' => {
@@ -24,15 +26,17 @@ describe Gitlab::Utils::InlineHash do
it 'transforms a nested hash into a one-level hash' do
is_expected.to eq(
- 'nested_param.key' => 'Value',
+ 'nested_param.key' => :Value,
'root_param' => 'Root',
+ :unnested_symbol_key => :unnested_symbol_value,
+ 12 => 22,
'very.deep.nested.param' => 'Deep nested value'
)
end
it 'retains key insertion order' do
expect(subject.keys)
- .to eq(%w(nested_param.key root_param very.deep.nested.param))
+ .to eq(['nested_param.key', 'root_param', :unnested_symbol_key, 12, 'very.deep.nested.param'])
end
context 'with a custom connector' do
@@ -40,8 +44,10 @@ describe Gitlab::Utils::InlineHash do
it 'uses the connector to merge keys' do
is_expected.to eq(
- 'nested_param::key' => 'Value',
+ 'nested_param::key' => :Value,
'root_param' => 'Root',
+ :unnested_symbol_key => :unnested_symbol_value,
+ 12 => 22,
'very::deep::nested::param' => 'Deep nested value'
)
end
@@ -52,8 +58,10 @@ describe Gitlab::Utils::InlineHash do
it 'prefixes all the keys' do
is_expected.to eq(
- 'options.nested_param.key' => 'Value',
+ 'options.nested_param.key' => :Value,
'options.root_param' => 'Root',
+ 'options.unnested_symbol_key' => :unnested_symbol_value,
+ 'options.12' => 22,
'options.very.deep.nested.param' => 'Deep nested value'
)
end
diff --git a/spec/lib/gitlab/utils/safe_inline_hash_spec.rb b/spec/lib/gitlab/utils/safe_inline_hash_spec.rb
index 8d8163f3baa..617845332bc 100644
--- a/spec/lib/gitlab/utils/safe_inline_hash_spec.rb
+++ b/spec/lib/gitlab/utils/safe_inline_hash_spec.rb
@@ -3,7 +3,7 @@
require 'fast_spec_helper'
describe Gitlab::Utils::SafeInlineHash do
- context '.merge_keys!' do
+ describe '.merge_keys!' do
let(:source) { { 'foo' => { 'bar' => 'baz' } } }
let(:validator) { instance_double(Gitlab::Utils::DeepSize, valid?: valid) }