You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: index_cache_test.rb
    path of file: ./repos/searchkick/test
    
    the code of the file until where you have to start completion: require_relative "test_helper"

class IndexCacheTest < Minitest::Test
 
    
  def with_threads
    previous = Thread.report_on_exception
    begin
      Thread.report_on_exception = true
      3.times.map { Thread.new { yield } }.map(&:join).map(&:value)
    ensure
      Thread.report_on_exception = previous
    end