class WebMock::HashValidator
def initialize(hash)
def initialize(hash) @hash = hash end
def validate_keys(*valid_keys)
def validate_keys(*valid_keys) valid_keys.flatten! @hash.each_key do |k| unless valid_keys.include?(k) raise ArgumentError.new("Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}") end end end