mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
11 lines
387 B
Ruby
11 lines
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
|