1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
httparty/spec/hash_spec.rb

11 lines
No EOL
387 B
Ruby

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