Sha256: cb205a3b3176b554b8604fb261b934b2b0b507354047652f92876b9182413db8

Contents?: true

Size: 495 Bytes

Versions: 68

Compression:

Stored size: 495 Bytes

Contents

require 'spec_helper'
require 'rollbar/util/hash'

describe Rollbar::Util::Hash do
  let(:value) do
    {
      :foo => 'bar',
      :bar => {
        :foo => 'bar',
        :bar => [{:foo => 'bar'}]
      },
    }
  end

  it 'converts the symbol keys to string' do
    new_hash = described_class.deep_stringify_keys(value)

    expect(new_hash['foo']).to be_eql('bar')
    expect(new_hash['bar']['foo']).to be_eql('bar')
    expect(new_hash['bar']['bar'][0]['foo']).to be_eql('bar')
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
rollbar-2.5.2 spec/rollbar/util/hash_spec.rb
rollbar-2.5.1 spec/rollbar/util/hash_spec.rb
rollbar-2.5.0 spec/rollbar/util/hash_spec.rb
rollbar-2.4.0 spec/rollbar/util/hash_spec.rb
rollbar-2.3.0 spec/rollbar/util/hash_spec.rb
rollbar-2.2.1 spec/rollbar/util/hash_spec.rb
rollbar-2.2.0 spec/rollbar/util/hash_spec.rb
rollbar-2.1.2 spec/rollbar/util/hash_spec.rb
rollbar-2.1.1 spec/rollbar/util/hash_spec.rb
rollbar-2.1.0 spec/rollbar/util/hash_spec.rb
rollbar-2.0.2 spec/rollbar/util/hash_spec.rb
rollbar-2.0.1 spec/rollbar/util/hash_spec.rb
rollbar-2.0.0 spec/rollbar/util/hash_spec.rb
rollbar-1.5.3 spec/rollbar/util/hash_spec.rb
rollbar-1.5.2 spec/rollbar/util/hash_spec.rb
rollbar-1.5.1 spec/rollbar/util/hash_spec.rb
rollbar-1.5.0 spec/rollbar/util/hash_spec.rb
rollbar-1.4.5 spec/rollbar/util/hash_spec.rb
rollbar-1.4.4 spec/rollbar/util/hash_spec.rb
rollbar-1.4.3 spec/rollbar/util/hash_spec.rb