diff options
author | icebaker <icebaker@proton.me> | 2024-01-10 20:05:48 -0300 |
---|---|---|
committer | icebaker <icebaker@proton.me> | 2024-01-10 20:05:48 -0300 |
commit | 3dc22548895718ffc7396227267ecbb4902b62f9 (patch) | |
tree | d19984eef953a2cd1e57c6fd51a73f2bcbb77541 /spec/logic/helpers | |
parent | a36604d266cb019311cdf67110596a16986a0fff (diff) |
improving markdown parser
Diffstat (limited to 'spec/logic/helpers')
-rw-r--r-- | spec/logic/helpers/hash_spec.rb | 9 |
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'] ) |