def stringify_hash hash, options = {}
      (raise ExpectationFailedError.new("stringify_hash called without a hash")) unless hash.is_a?(Hash)
      hash.inject({}) do |result, (k,v)|
        key = options[:downcase] ? k.to_s.downcase : k.to_s
        if v.is_a?(Hash) then
          result[key] = stringify_hash(v)
        elsif v.is_a?(Regexp) && options[:rewrite_regex] then
          result[key] = v.inspect[1..-2]
        else
          result[key] = v
        end
        result
      end
    end
def stringify_hash hash, options = {}
      (raise ExpectationFailedError.new("stringify_hash called without a hash")) unless hash.is_a?(Hash)
      hash.inject({}) do |result, (k,v)|
        key = options[:downcase] ? k.to_s.downcase : k.to_s
        if v.is_a?(Hash) then
          result[key] = stringify_hash(v)
        elsif v.is_a?(Regexp) && options[:rewrite_regex] then
          result[key] = v.inspect[1..-2]
        else
          result[key] = v
        end
        result
      end
    end
Given a hash, convert all keys to strings
 @see #symbolize_hash