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.18.2 spec/rollbar/util/hash_spec.rb
rollbar-2.18.0 spec/rollbar/util/hash_spec.rb
rollbar-2.17.0 spec/rollbar/util/hash_spec.rb
rollbar-2.16.4 spec/rollbar/util/hash_spec.rb
rollbar-2.16.3 spec/rollbar/util/hash_spec.rb
rollbar-2.16.2 spec/rollbar/util/hash_spec.rb
rollbar-2.16.0 spec/rollbar/util/hash_spec.rb
rollbar-2.15.6 spec/rollbar/util/hash_spec.rb
rollbar-2.15.5 spec/rollbar/util/hash_spec.rb
rollbar-2.15.4 spec/rollbar/util/hash_spec.rb
rollbar-2.15.3 spec/rollbar/util/hash_spec.rb
rollbar-2.15.2 spec/rollbar/util/hash_spec.rb
rollbar-2.15.1 spec/rollbar/util/hash_spec.rb
rollbar-2.15.0 spec/rollbar/util/hash_spec.rb
rollbar-2.14.1 spec/rollbar/util/hash_spec.rb
rollbar-2.14.0 spec/rollbar/util/hash_spec.rb
rollbar-2.13.3 spec/rollbar/util/hash_spec.rb
rollbar-2.13.2 spec/rollbar/util/hash_spec.rb
rollbar-2.13.1 spec/rollbar/util/hash_spec.rb
rollbar-2.13.0 spec/rollbar/util/hash_spec.rb