class RubyIndexer::TestCase

def assert_entry(expected_name, type, expected_location, visibility: nil)

def assert_entry(expected_name, type, expected_location, visibility: nil)
  entries = @index[expected_name] #: as !nil
  refute_nil(entries, "Expected #{expected_name} to be indexed")
  refute_empty(entries, "Expected #{expected_name} to be indexed")
  entry = entries.first #: as !nil
  assert_instance_of(type, entry, "Expected #{expected_name} to be a #{type}")
  location = entry.location
  location_string =
    "#{entry.file_path}:#{location.start_line - 1}-#{location.start_column}" \
      ":#{location.end_line - 1}-#{location.end_column}"
  assert_equal(expected_location, location_string)
  assert_equal(visibility, entry.visibility) if visibility
end