class Inspec::Resolver

def detect_duplicates(deps, top_level, path_string)

def detect_duplicates(deps, top_level, path_string)
  seen_items_local = []
  deps.each do |dep|
    if seen_items_local.include?(dep.name)
      problem_cookbook = if top_level
                           "the inspec.yml for this profile."
                         else
                           "the dependency information for #{path_string.split(" ").last}"
                         end
      raise Inspec::DuplicateDep, "The dependency #{dep.name} is listed twice in #{problem_cookbook}"
    else
      seen_items_local << dep.name
    end
  end
end