def matching_body_hashes?(query_parameters, pattern, content_type)
      return false unless query_parameters.is_a?(Hash)
      return false unless query_parameters.keys.sort == pattern.keys.sort
      query_parameters.each do |key, actual|
        expected = pattern[key]

        if actual.is_a?(Hash) && expected.is_a?(Hash)
          return false unless matching_body_hashes?(actual, expected, content_type)
        else
          expected = WebMock::Util::ValuesStringifier.stringify_values(expected) if url_encoded_body?(content_type)
          return false unless expected === actual
        end
      end
      true
    end
def matching_body_hashes?(query_parameters, pattern, content_type)
      return false unless query_parameters.is_a?(Hash)
      return false unless query_parameters.keys.sort == pattern.keys.sort
      query_parameters.each do |key, actual|
        expected = pattern[key]

        if actual.is_a?(Hash) && expected.is_a?(Hash)
          return false unless matching_body_hashes?(actual, expected, content_type)
        else
          expected = WebMock::Util::ValuesStringifier.stringify_values(expected) if url_encoded_body?(content_type)
          return false unless expected === actual
        end
      end
      true
    end
Compare two hashes for equality

 For two hashes to match they must have the same length and all
 values must match when compared using `#===`.

 The following hashes are examples of matches:

     {a: /\d+/} and {a: '123'}

     {a: '123'} and {a: '123'}

     {a: {b: /\d+/}} and {a: {b: '123'}}

     {a: {b: 'wow'}} and {a: {b: 'wow'}}

 @param [Hash] query_parameters typically the result of parsing
   JSON, XML or URL encoded parameters.

 @param [Hash] pattern which contains keys with a string, hash or
   regular expression value to use for comparison.

 @return [Boolean] true if the paramaters match the comparison
   hash, false if not.