Sha256: 81ba5357ea3585cf1b413606d4276fd198e0a003b8592f73dde1bf4bc75f52dc

Contents?: true

Size: 387 Bytes

Versions: 7

Compression:

Stored size: 387 Bytes

Contents

require File.join(File.dirname(__FILE__), 'spec_helper')

describe HTTParty::CoreExt::HashConversions do
  it "should convert hash to struct" do
    {'foo' => 'bar'}.to_struct.should == OpenStruct.new(:foo => 'bar')
  end
  
  it 'should convert nested hash to struct' do
    {'foo' => {'bar' => 'baz'}}.to_struct.should == OpenStruct.new(:foo => OpenStruct.new(:bar => 'baz'))
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
francxk-httparty-0.1.3 spec/hash_spec.rb
francxk-httparty-0.1.4 spec/hash_spec.rb
jnunemaker-httparty-0.1.1 spec/hash_spec.rb
httparty-0.1.3 spec/hash_spec.rb
httparty-0.1.1 spec/hash_spec.rb
httparty-0.1.0 spec/hash_spec.rb
httparty-0.1.2 spec/hash_spec.rb