This could be nasty bug for developers.Maybe it is good idea to handle such cases by notifyiing user. it "should raise error for duplicate keys" do struct = DeepStruct.wrap({:a => "hello", 'a' => "world"}) struct.a.should eq struct[:a] end