Sha256: 16b418c8408fc8433909f1e95105872e4b304c7dc36d6d7a16d3a051f560bb92

Contents?: true

Size: 402 Bytes

Versions: 36

Compression:

Stored size: 402 Bytes

Contents

require 'spec_helper'

describe ButterCMS::HashToObject do
  describe '.convert' do
    it 'converts hash to object' do
      hash = {
        "key1" => "value",
        "key2" => {
          "nested_key" => "nested value"
        }
      }

      obj = ButterCMS::HashToObject.convert(hash)

      expect(obj.key1).to eq 'value'
      expect(obj.key2.nested_key).to eq "nested value"
    end
  end
end

Version data entries

36 entries across 36 versions & 3 rubygems

Version Path
buttercms-ruby-zwg-2.5.7 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-zwg-2.5.2 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-zwg-2.5.3 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-zwg-2.4.2 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-zwg-2.4.1 spec/lib/buttercms/hash_to_object_spec.rb
zuzanky-buttercms-ruby-2.4 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-2.4 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-2.3 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-2.2 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-2.1 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-2.0 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.9 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.8 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.7 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.6 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.5 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.4 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.3.2 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.3.1 spec/lib/buttercms/hash_to_object_spec.rb
buttercms-ruby-1.3.0 spec/lib/buttercms/hash_to_object_spec.rb