find_tested

in report/lib/api_endpoint.rb [110:132]


    def find_tested(flavour)
      Dir[TESTS_PATH].map do |path|
        relative_path = path[path.index('/tests')..]
        file_content = File.read(path)
        
        next unless file_content.include?("#{flavour}: true") && file_content.include?(@name)

        file_content.split("\n").each_with_index do |line, index|
          next if line.empty?

          api_mention = line.split(':')[0].strip.gsub('"', '')
          next unless api_mention == @name
          next unless Regexp.new(/^

          return {
            file: ".#{relative_path}",
            line: index + 1
          }
        end
      end
      {}
    end