summaryrefslogtreecommitdiff
path: root/spec/logic/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/logic/helpers')
-rw-r--r--spec/logic/helpers/hash_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/logic/helpers/hash_spec.rb b/spec/logic/helpers/hash_spec.rb
index 09012c8..5e4ec60 100644
--- a/spec/logic/helpers/hash_spec.rb
+++ b/spec/logic/helpers/hash_spec.rb
@@ -7,7 +7,16 @@ RSpec.describe NanoBot::Logic::Helpers::Hash do
expect(described_class.symbolize_keys({ 'a' => 'b', 'c' => { 'd' => ['e'] } })).to eq(
{ a: 'b', c: { d: ['e'] } }
)
+ end
+
+ it 'stringify keys' do
+ pp described_class.stringify_keys({ a: 'b', c: { d: [:e] } })
+ expect(described_class.stringify_keys({ a: 'b', c: { d: [:e] } })).to eq(
+ { 'a' => 'b', 'c' => { 'd' => [:e] } }
+ )
+ end
+ it 'fetch a path of keys' do
expect(described_class.fetch({ a: 'b', c: { d: ['e'] } }, %i[c d])).to eq(
['e']
)